Skip to content

Polish the paste page: one instrument, quieter chrome - #16

Merged
liuyingjierun merged 5 commits into
mainfrom
paste-page-polish
Sep 2, 2026
Merged

liuyingjierun merged 5 commits into
mainfrom
paste-page-polish

Conversation

@liuyingjierun

Copy link
Copy Markdown
Contributor

Five changes to the page, from your notes on it.

The editor and the preview are one card

They were two bordered boxes with a gap down the middle, and two of
these commits are attempts to make two separate things look related —
first by forcing a shared height, then by evening out the padding the
forcing had unbalanced. One card with a hairline down the middle
removes the problem rather than managing it.

The halves are grid tracks, so they are equal by construction: 359px
each at nine lines, 777 at thirty, 336 at one — where the old
arrangement had them 182px apart at one line. Neither half draws an
edge; the labels are a strip along the top of each, ending on the same
line. Stacked below 860px the rule moves from the side to the top.

The editor grows with the row instead of scrolling inside a fixed box,
so the resize handle is gone with nothing lost — at thirty lines the
textarea is 741px and still not scrolling.

The scrollbars

Two of them, both the browser's default: a pale slab across the foot of
the rendered block and another down the side of the HTML box.

jsray.css already answers this for a class-rendered block, but it does
it through ::-webkit-scrollbar — a pseudo-element, which cannot be
written inline. So a portable block never had it, at the destination
either. scrollbar-width and scrollbar-color are real properties, say
the same thing, and travel with the block.

The copy button

Pressing it changed nothing about it; the result appeared two elements
to the right. It reports on itself now — mint for copied, amber for
refused — with the note beside it cut to the part worth reading. Fixed
width so the row does not jump, AAA contrast on all three states, and
the press animation drops under prefers-reduced-motion.

Also

Assigning to a textarea's value leaves the caret at the end and the
browser scrolls there, so the HTML box opened on the middle of the
markup every time a setting changed.

Verification

164 tests. Measured at seven widths from 375 to 1440: the divider
switches sides at the breakpoint, the two halves stay equal wherever
they are side by side, and nothing scrolls sideways. All three copy
paths exercised in a browser, and the live update checked by typing
into the editor rather than by reading the listener back.

Pressing it changed nothing about it. The result appeared as a line of
text two elements to the right — the one place you are not looking at
the moment you press a button.

The button reports it now: mint for copied, amber for refused, with
the note beside it cut down to the part worth reading — which formats
went, or what to do when the browser blocks it. The width is fixed so
the row does not jump when the label changes, and it resets after a
few seconds.

A press can also be felt rather than assumed: an inset highlight, a
lift on hover, a 1px drop on active. Dropped under
prefers-reduced-motion.

Contrast on all three states is AAA (7.6, 9.4, 9.8). The target is
44px under a coarse pointer, and in the single-column layout the
button takes the full width its fields already have rather than
sitting at 200px beside them.

All three paths exercised in a browser: the primary clipboard write,
the rich-text fallback, and both failing — which also focuses and
selects the HTML for a manual copy.
Two of them, both the browser's default: a pale slab across the foot of
the rendered block and another down the side of the HTML box, on a page
that is otherwise dark and quiet.

jsray.css already answers this for a class-rendered block, with an 8px
bar coloured from the palette — but it does it through
::-webkit-scrollbar, and a pseudo-element cannot be written inline. So
a portable block never had it, at the destination either. scrollbar-width
and scrollbar-color are real properties, say the same thing, and travel
with the block; where a browser does not know them it keeps the
scrollbar it would have had anyway.

The page's own textareas get both spellings, since the ::-webkit- rules
still cover the versions that predate the standard ones.

Also: assigning to a textarea's value leaves the caret at the end and
the browser scrolls there, so the HTML box opened on the middle of the
markup every time a setting changed. It starts at the start now.
They are a before and an after of the same thing, and they ended in
different places. The editor stopped at its 300px minimum while the
preview ran on to whatever the block needed — 30px lower — so the pair
read as two boxes that happened to be next to each other.

Stretching the row makes them end together. The preview also inset its
contents by 14px against the editor's 10px, which put the rendered
block 5px further in than the code it is a rendering of; both are 11px
now, so a line of code sits directly opposite the line it became.

Only while they are side by side: stacked on a narrow screen there is
nothing to align to, and forcing a shared height there would spend
vertical space a phone does not have. Measured at eight widths — equal
height and a common baseline above 900px, an even inset at all of them.
Stretching the surface to the row's height put every pixel the row was
taller than the block into one gap along the bottom — 70px against 10
on the other three sides, which is what you notice.

It hugs the block now, with 10px all round and no minimum height; a
minimum is the same gap under another name whenever the block is
shorter than it.

That trades away the shared bottom edge, but only where the editor is
being held open by its own 300px minimum: at nine lines both panes are
321px and at twenty-six both are 654px, ending together in each case.
It is one line of code that separates them, by 182px, and the minimum
is there so the box is still worth typing in.
They were two bordered boxes with a gap down the middle, and the last
two changes were both attempts to make two separate things look
related — first by forcing a shared height, then by evening out the
padding the forcing had unbalanced.

One card with a hairline down the middle removes the problem instead of
managing it. The halves are grid tracks, so they are equal by
construction: 359px each at nine lines, 777 at thirty, 336 at one —
where the old arrangement had them 182px apart. Neither half draws an
edge any more; the labels are a strip along the top of each, ending on
the same line. Stacked below 860px the rule moves from the side to the
top, which is the only thing that changes.

The editor grows with the row rather than scrolling inside a fixed box,
so the resize handle is gone with nothing lost — at thirty lines the
textarea is 741px and still not scrolling.

Typing on the left still shows on the right as you type; checked by
typing into it rather than by reading the listener back.
@liuyingjierun
liuyingjierun merged commit ca45f04 into main Sep 2, 2026
4 checks passed
@liuyingjierun
liuyingjierun deleted the paste-page-polish branch September 2, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant