DEV Community

Diiiii
Diiiii

Posted on

Designing a Reviewable Document Conversion State Machine

This is a public-interface design exercise, not a claim about private implementation.

Define the input contract

A conversion service should expose what it accepts and what the user can expect. Separate selectable text, scanned pages, and bundled assets. For a browser workflow, an HTML file and a ZIP archive are different contracts because the archive may contain stylesheets and images.

type Job = {
input: 'html' | 'zip' | 'rtf' | 'unknown';
options: { grayscale: boolean; landscape: boolean; noBackground: boolean; noJavascript: boolean };
status: 'queued' | 'rendering' | 'review' | 'failed' | 'exported';
warnings: string[];
};
Make options explicit

The public page shows rendering switches for grayscale, landscape, removing backgrounds, and disabling JavaScript. These are product-level choices, not implementation details. Persist them with the job so a reviewer can reproduce an output instead of guessing which checkbox was used.

Test the review state

A useful test does not assert a guessed CSS selector. It asks whether the result can be inspected: are all thumbnails labeled, can a failed item be retried, and is the prior revision preserved? If the user searched for RTF to PDF Converter, add an input-compatibility test before any visual test.

A small acceptance matrix

The RTFtoPDF.com interface is a convenient reference for this kind of contract thinking. The lesson is broader: conversion is complete only when its assumptions are reviewable.

Accessibility boundary

Color-only warnings, keyboard traps, and unlabeled download controls turn a successful render into a failed workflow. Test the states a real operator must understand, not just the file extension. Designing a Reviewable Document Conversion State Machine

This is a public-interface design exercise, not a claim about private implementation.

Define the input contract

A conversion service should expose what it accepts and what the user can expect. Separate selectable text, scanned pages, and bundled assets. For a browser workflow, an HTML file and a ZIP archive are different contracts because the archive may contain stylesheets and images.

type Job = {
input: 'html' | 'zip' | 'rtf' | 'unknown';
options: { grayscale: boolean; landscape: boolean; noBackground: boolean; noJavascript: boolean };
status: 'queued' | 'rendering' | 'review' | 'failed' | 'exported';
warnings: string[];
};
Make options explicit

The public page shows rendering switches for grayscale, landscape, removing backgrounds, and disabling JavaScript. These are product-level choices, not implementation details. Persist them with the job so a reviewer can reproduce an output instead of guessing which checkbox was used.

Test the review state

A useful test does not assert a guessed CSS selector. It asks whether the result can be inspected: are all thumbnails labeled, can a failed item be retried, and is the prior revision preserved? If the user searched for RTF to PDF Converter, add an input-compatibility test before any visual test.

A small acceptance matrix

The RTFtoPDF.com interface is a convenient reference for this kind of contract thinking. The lesson is broader: conversion is complete only when its assumptions are reviewable.

Accessibility boundary

Color-only warnings, keyboard traps, and unlabeled download controls turn a successful render into a failed workflow. Test the states a real operator must understand, not just the file extension.

Top comments (0)