Skip to content

Keep each Details mark beside its value, with wrapped lines under the text - #45

Closed
threeqube wants to merge 1 commit into
mainfrom
details-mark-hanging
Closed

threeqube wants to merge 1 commit into
mainfrom
details-mark-hanging

Conversation

@threeqube

Copy link
Copy Markdown
Collaborator

Closes #44

What changed

Each Details row's value starts with a small mark (✓, ⓘ, ✕). It was laid out as part of the text, which caused two problems:

  • A word too long to fit beside the mark, such as an issuer's did:key, left the mark alone on the line above.
  • A wrapped value's second line started back under the mark.

The mark is now a bullet. It stays on the value's first line, and every line of the value starts just after it.

before                                      after
ⓘ Springfield College — not on our list of   ⓘ Springfield College — not on our list of
known issuers                                  known issuers

CSS only (src/verifier-credential.ts); no markup, wording or verdict logic changes.

One decision to flag: in a wide card, where label and value sit side by side, a value that wraps now has its lines start-aligned (left-aligned in English) just after the mark, rather than right-aligned. One-line values still sit at the row's end as before. Across the 12 demos at 1024px, only the "Registry offline" Issuer value wraps.

Also from review:

  • Words that can't wrap no longer push the mark over the label. This affects Safari before 15.4 (no overflow-wrap: anywhere) and host pages that set white-space: nowrap.
  • A host page that centres its text no longer centres the labels away from their values.

Testing

  • New tests: 5 layout tests fail on main and pass here:
    • a did:key at 360px and 1024px;
    • wrapped lines in stacked rows (left-to-right and right-to-left) and in side-by-side rows.
  • Review fixes: each has a test that fails when the fix is removed. The fixes cover the mark staying round, words that can't wrap, a centred host page, and side-by-side right-to-left.
  • Screen readers: a new test checks each row is read as label, status word, value, with the mark hidden. Chrome's own accessibility tree gives identical text to main for all 12 demos at 360px and 1024px.
  • Layout against main:
    • At 1024px, every one-line value across the 12 demos sits where it did on main, to within 0.5px.
    • Row heights are unchanged at 360px and 1024px, measured on "Issuer unknown".
    • In right-to-left the mark now mirrors exactly; before, it sat 2px off.
  • Wallet: built and packed release-style, then installed into a copy of the wallet. Its own Verifier slot was checked at 320, 360 and 600px:
    • main shows both bugs and this branch fixes both;
    • the wallet's tests/verifier-plugin.spec.ts passes with both packages;
    • its production build passes.
  • Other engines: layout tests also pass in WebKit and Firefox (run locally).
  • Local runs: typecheck, lint and unit tests pass. The full browser suite couldn't run cleanly locally because port 5180 was in use; the 8 status-list tests that need it fail the same way on main. CI runs the full suite.
  • Reviews: two fresh-context reviews (CSS and accessibility; tests), then a diff-only re-review of the fixes. No open Important findings. A security review found nothing.

Risk

Low. The change is cosmetic and limited to the Details rows. The worst case is a mark or line slightly out of place in some browser; the text, the verdict and what screen readers hear don't change. The wallet picks this up only when its verifier-plugin pin is bumped.

How to revert

Revert the single commit. Nothing else depends on it.

Deferred

A host page that sets white-space: nowrap still makes long Details values run past the card. That happens on main too; it's worth a follow-up issue.

🤖 Generated with Claude Code

… text

Each Details row's value starts with a small mark (✓, ⓘ, ✕). It was laid
out inline, as part of the text, so a word too long to fit beside it, such
as an issuer's did:key, left the mark alone on the line above, and a wrapped
value's next line started back under the mark rather than under the first
word.

The mark is now a bullet: a flex item beside the words, on their first line,
with every line of the words starting just after it. Stacked, the value still
starts under its label. Side by side, the mark and words still sit at the
row's end, but a value that wraps is start-aligned inside that, so its lines
start under its first word rather than being pushed away from the mark.
Right-to-left pages mirror the layout, now exactly: the old 2px margin was on
the mark's right in either direction.

From review: the words may shrink beside the mark (min-width: 0), so words
that cannot break, in a browser without overflow-wrap: anywhere or under a
host page's white-space: nowrap, no longer push the mark back over the label.
The rows also set text-align themselves, so a host page that centres its text
no longer centres the labels.

Screen readers are given the same words as before, and the mark stays hidden
from them. The did:key test expected the mark above the identifier; it now
expects it beside it. The wide-row test measured a value's last line, which
no longer reaches the row's end once a value wraps; it measures one-line
values by their text and wrapped ones by their box.

Closes #44

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Try it: https://digitalcredentials.github.io/verifier-plugin/pr-45/

Updates on every push to this PR, and goes away when it closes. The browser tests run against this copy too.

@threeqube

Copy link
Copy Markdown
Collaborator Author

Closing without merging: on reflection this cosmetic change isn't worth carrying. #44 is closed as not planned.

@threeqube threeqube closed this Nov 7, 2026
@threeqube
threeqube deleted the details-mark-hanging branch November 7, 2026 03:19
github-actions Bot added a commit that referenced this pull request Nov 7, 2026
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.

Keep each Details mark beside its value, with wrapped lines starting under the text

1 participant