html-revisor: design

Everything html-revisor adds to a page, drawn with the real stylesheet. This page links client.css; change the stylesheet and both the tool and this page change.

Imperatives

  1. Distinct from the page it revises. The page can be any colors and any styling.
  2. Consistent with itself, so people can always tell which UI came from html-revisor.
  3. Clear what is happening.

Decisions

How the tool looks. How editing as markdown behaves is in SCOPES-DESIGN.html.

Decided

(direction): decided, not built yet.

Not decided

Everything below this section is today's prototype. Where it disagrees with Decided, Decided wins.

Stress test: any page

Imperative 1. Color alone can't be distinct from every page: some page uses our pink. So every mark gets a halo, a white ring and a dark shadow: a light edge and a dark edge whatever the page.

Has a directive

Hovered

Box open

white

Has a directive

Hovered

Box open

near-black

Has a directive

Hovered

Box open

our pink

Has a directive

Hovered

Box open

red

Has a directive

Hovered

Box open

stripes

Has a directive

Hovered

Box open

pink border

Has a directive

Hovered

Box open

photo behind text

hills under a pink sky

img: hovered, has a directive

Has a directive

Hovered

Box open

cat behind text

orange cat lying on a patterned tablecloth among game pieces

cat img: hovered

orange cat lying on a patterned tablecloth among game pieces

cat img: box open

What it shows. The halo keeps the crop marks visible on every ground, and the marker carries its own light ring and dark tile. On our pink, the white edge carries the corners; on the cat, the dark edge keeps them off the pale fur. The page element is never restyled, so the tile looks the same with or without the marks. The marker says "this element has a directive". It sits flush left of the first line.

Palette

Custom properties on :root, the same in light and dark mode: the material doesn't follow the page. Values are read from the stylesheet when the page loads.

accent: icon, crop marks, main action, focus; your turns
reply: the agent's voice, its turns and the new-reply bubble
error: failed or stale save
surface: every component
ring: the 1px edge around every component
field: textareas
button: secondary actions, one step lighter than the surface so they read as buttons
line: borders inside a component
text: white, the same as the ring
muted: labels, hint, placeholder
halo: light edge on crop marks

On the page

The tool draws in its own layer above the page and puts no classes on page elements.

Hovering an element puts crop marks at its corners, and the cursor becomes a copy cursor: click to leave a directive or to edit the text. An element an agent marks data-no-revise, and all inside it, stays the page's: no marks, no copy cursor, and clicks go to the page.

.hrv-crop: four 10px corners, 2px thick, --hrv-crop-gap (4px) outside the element's box, with the halo. Each arm is at most 30% of its side, so a small SVG label still shows four corners. .hrv-selected, while the box is open: 16px corners, 3px thick, and a 1px outline.

This paragraph has a directive, and so does the div around it. Their markers sit side by side, left of the first line.

Say this in fewer words

.hrv-marker: the icon on a 20px tile of the material, outside its element's box and flush against it, so it never covers what it marks and never reads as a neighbor's. It sits left of the first line, top edges aligned, over the crop mark at that corner; with no room on the left, above the top-left corner. The pencil tip points at the element either way. A marker that would land on another steps outward, left or up, and the inner element keeps the nearest spot. Hovering a marker shows crop marks on its element and .hrv-tip: whatever was said last in the thread, in the material, above the marker, or below it when there is no room.

The agent replied here, and it's your turn.

Added a sequence diagram below this paragraph.

.hrv-answered: a new reply, the agent spoke last. A green speech bubble takes the pencil's place, until you add a turn or Resolve; opening the box doesn't change it. The file says it, so a reload keeps it. Nothing moves. Its tip is the reply, with .hrv-tip-reply's green rule.

You closed the box, and the agent has your turn.

Add a diagram of the PUT flow here

.hrv-working: your turn is the last in the thread and its box is closed, so the agent has it. Three green squares, still, between the pencil and the bubble; the agent's reply ends it. While the box is open it's the pencil: you're still writing. Its tip is your last turn.

Directive box

Opens beside its element: below, above, right, or left, the first side with room in the viewport. It keeps that side while it fits, so it doesn't flip as the element grows under typing. With no room on any side (a tall element, a phone), it pins to the viewport edge farthest from what shows of the element. Along the other axis it shifts to stay in view, and the notch slides along its edge to point at the element. 320px wide or the viewport less 16px. The header names the element: its tag and the start of its text, or its alt. Saves 0.4 s after typing stops, and the footer says so: "saving…", then "saved" for 2 s, or "not saved" when the file changed on disk. Done, ⌘↵ and esc close it. Each field has a label line; its action sits at the right and shows only when it has something to do: Revert on Content, Clear on Directive. Clear empties the directive and leaves the box open, so work in the Content field goes on; ⌥⌘⌫ does the same, and ⌘Z brings the directive back. Fields grow with their text up to 240px, then scroll. The grip in the bottom-right corner (.hrv-grip) resizes the box: drag across for width, down for field height, and Content then holds that height even when short. The size holds for every box and across reloads; a double-click on the grip goes back to the usual size. The Content field wears the element's font, its size held between 12 and 20px.

Where it's headed

p · Where it's headed
Directive
saved

Any element. Below it, the notch on top.

Where it's headed

h3 · Where it's headed
Content
Directive
⌘↵ or esc to close

A directive box with editor, for a scope: its field holds the scope's markdown. Above it, the notch below.

Thread

Once the agent replies, .hrv-thread shows the turns between Content and your field, one .hrv-turn each. A rule at the left and a word say whose: magenta you, green agent (.hrv-agent). The turns stay as written. Your field becomes You, and what you type is your next turn. Resolve, beside Done, ends the thread: the directive and its replies go. The thread grows to 240px, then scrolls, and opens scrolled to the end. A reply that comes in while the box is open joins the thread there: the turn it answers goes up into the thread, and your field keeps what you typed past it, as your next turn.

Where it's headed

p · Where it's headed
Content
you Add a diagram of the PUT flow here
agent Added a sequence diagram below this paragraph. I left out the retry path: it doubled the size. Want it as a second diagram?
You
saved

Answered, and you're typing the next turn.

Where it's headed

p · Where it's headed
you Add a diagram of the PUT flow here
agent working
You
⌘↵ or esc to close

Working. You reopened a box whose turn you'd sent: it shows in the thread as you wrote it, and the agent's turn and the box's icon show .hrv-dots. The field adds your next turn, which joins the one you sent and makes the reply the agent is writing stale.

Revert and Clear

For "oh no, I didn't mean to delete that": put a scope's content back to what it held at the last commit.

Where it's headed

section · Where it's headed
Content
Directive
saved

A section whose second paragraph was just deleted. Revert sits on the Content label's line, at the right: it names what it puts back, and it stays away from Done. Each field's action sits on its label's line, and shows only when it has something to do: Revert when the content changed, Clear when there is a directive. Clear, not ×: an × reads as closing the box. Labels are small capitals in the muted gray; the actions are quiet text. The footer holds what belongs to the whole box: "saved", which covers both fields, and Done.

Where it's headed

p · Where it's headed
Directive
saved

The plain box, on an element that isn't a scope, gets the same Directive label and Clear, so Clear is in one place in both boxes.

Keyboard

Tab goes round the box in reading order: Revert, Content, Clear, Directive, Done, then back to the start. Shift-Tab goes the other way. An action that's hidden takes no stop. Esc is the way out; Tab never leaves the box, and never types a tab into a field. Enter or Space presses the button Tab is on.

Where it's headed

section · Where it's headed
Content
Directive
⌘↵ or esc to close

Tabbed to Revert. The ring is an outline, 2px out, so the label line doesn't move.

Where it's headed

p · Where it's headed
Directive
⌘↵ or esc to close

Tabbed to Done. The ring stands off the accent fill by 2px of the box's surface. A click shows no ring: :focus-visible.

Icon

.hrv-icon: a magenta pencil, drawn as a mask from --hrv-pencil so it takes the accent. The tip faces right: the icon sits on the left of what it marks and points at it. The marker is the same pencil on a tile of the material.

icon, in a component

Docket

.hrv-docket: bottom right of the window, always there. The count follows each keystroke. ↑ and ↓ (or ⌥↑ and ⌥↓, when the focus isn't in a text field) step through the directives in document order, wrapping at the ends: the element scrolls to the middle of the window, shows its crop marks for 2 s, and its marker shows its tip, so you read each directive as you step. The tip stays until the next click. Stepping doesn't open the box, since the box takes the focus and covers the page; the marker is right there to open it. Clicking the icon and count turns review mode off: no markers, no hover marks, no copy cursor, and clicks go to the page, links included. Click again to turn it back on. A save error stays on the docket until a save succeeds; the stale-file warning stays until reload.

3 directives
↑
↓
0 directives
↑
↓

Counting; with no directives, it shows only the count.

3 directives · review off
↑
↓

Review mode off: the icon and words go grey, and the arrows hide, with ⌥↑ and ⌥↓: with the marks hidden there is nothing to step to.

save failed: Failed to fetch
3 directives
↑
↓

Save failed. The next edit retries.

file changed on disk — reload to see it (your unsaved text is in the box)
4 directives
↑
↓

Stale file: no more saves until reload.

A second row, .hrv-row2, counts new replies: threads where the agent spoke last, with the green bubble (.hrv-icon-reply). Its own ↑ and ↓ step through them the same way. Adding a turn takes one off it, and Resolve takes it off both rows; opening the box changes nothing. With no new replies the row hides and the docket is one row; with some, it's .hrv-stacked, a grid, so both counts take the width the wider needs. When a reply comes, the docket wears a green ring for 2 s (.hrv-arrived), since its element may be off screen.

5 directives
↑
↓
2 new replies
↑
↓

Two new replies, among five open threads.

5 directives
↑
↓
3 new replies
↑
↓

A reply just came: the green ring, for 2 s.

Type

One size, 13px at line height 1.4, everywhere in the layer. --hrv-font is system-ui. The directive field is --hrv-mono, monospace, since a directive is an instruction headed into an HTML comment. Labels and the hint differ by color alone: muted; the save status that replaces the hint takes the text color. The Content field: the element's own font.