Public: anyone can read this; the crew can change it.

The origins page's handoff and connect path draw §5's card, row and btn, and .handoff, .handoff-links, .connect-more, .connect-path leave the markup #4211

opened this

Merged 46d 1h ago, live in production

The origins page no longer uses .handoff, .handoff-links, .connect-more or .connect-path anywhere in its HTML. bun x tsc --noEmit is clean. bun test on test/design-lint.test.ts, test/web-origins.test.ts and test/origins-oauth.test.ts passes (56 tests).

Notes

opened this

The origins page no longer uses .handoff, .handoff-links, .connect-more or .connect-path anywhere in its HTML. bun x tsc --noEmit is clean. bun test on test/design-lint.test.ts, test/web-origins.test.ts and test/origins-oauth.test.ts passes (56 tests). I did not run the whole suite. There are no screenshots, since the sandbox has no browser.

What changed (src/web/pages/origins.ts)

  • Connect card: the three paths (token, GitHub, Forgejo/Gitea) are now rows that fold open inside the existing "Connect an origin" card.
    • The token row is always open. The two one-click rows open when values.mode !== "none", as the old <details> did.
    • Each row's body is the same paragraphs, steps and forms as before, with the same fields and actions.
  • One-click sign-in text: the old <summary> and its paragraph moved into the card footer. The paragraph still reads the same and the bold lead-in is "One-click sign-in."
  • Flow page handoff: the QR code sits in a bar, the short and full links are rows, and the open button is a btn. The element ids (flow-short, flow-url) and the copy buttons are unchanged.

Tests (test/web-origins.test.ts)

  • Extended the empty-page test and the flow-page test. Both now assert the four old class names are absent, and that the words, links and form actions are present.
  • Neither assertion could fail before this change, since the old markup contained those classes.

Left alone, as the issue says: src/web/style/content.ts and docs/DESIGN.md. The old rules are now unused until part two removes them.

Look at: the QR now has no background, border or fixed size from the stylesheet, so how it sits on the flow page needs a look in the preview.

Closes #4154

2 earlier comments
commented

The origins page no longer uses .handoff, .handoff-links, .connect-more or .connect-path anywhere in its HTML. bun x tsc --noEmit is clean. bun test on test/design-lint.test.ts, test/web-origins.test.ts and test/origins-oauth.test.ts passes (56 tests). I did not run the whole suite. There are no screenshots, since the sandbox has no browser.

What changed (src/web/pages/origins.ts)

  • Connect card: the three paths (token, GitHub, Forgejo/Gitea) are now rows that fold open inside the existing "Connect an origin" card.
    • The token row is always open. The two one-click rows open when values.mode !== "none", as the old <details> did.
    • Each row's body is the same paragraphs, steps and forms as before, with the same fields and actions.
  • One-click sign-in text: the old <summary> and its paragraph moved into the card footer. The paragraph still reads the same and the bold lead-in is "One-click sign-in."
  • Flow page handoff: the QR code sits in a bar, the short and full links are rows, and the open button is a btn. The element ids (flow-short, flow-url) and the copy buttons are unchanged.

Tests (test/web-origins.test.ts)

  • Extended the empty-page test and the flow-page test. Both now assert the four old class names are absent, and that the words, links and form actions are present.
  • Neither assertion could fail before this change, since the old markup contained those classes.

Left alone, as the issue says: src/web/style/content.ts and docs/DESIGN.md. The old rules are now unused until part two removes them.

Look at: the QR now has no background, border or fixed size from the stylesheet, so how it sits on the flow page needs a look in the preview.

commented

The flow-page handoff now wraps its links and keeps its copy buttons on screen. tsc is clean and test/design-lint.test.ts, test/web-origins.test.ts and test/origins-oauth.test.ts pass. I couldn't check it at 360px, since the sandbox has no browser.

  • Layout: the short link and full link are now rows in a list setting-list. Each row's title is its label ("Or open this on a phone:", "The full link:"). The value is the wrapping row-meta, and the copy button is in row-trail. Nothing is left inside the ellipsizing .row-title. The flow-short and flow-url ids are unchanged, so the copy targets still work.
  • No JavaScript: the copy button is still hidden, but the full link now wraps and can be read and selected.
  • QR size: a new qrScale() picks the module size so the code is at most 200px square. A long URL used to give a larger code. The code also now carries a max-width of 200 via that scale, not via the stylesheet.
  • New test assertions:
    • the flow-short and flow-url values sit in row-meta, outside .row-title;
    • no .row-title contains a data-copy attribute or a flow- id;
    • the copy button is in row-trail;
    • the QR width is at most 200.

I did not edit docs/DESIGN.md, because #4154 says part two owns it. Part two is #4155, ".handoff, .handoff-links, .connect-more, .connect-path leave the stylesheet and docs/DESIGN.md §5d". Until it lands, those four rules stay in src/web/style/content.ts as dead CSS, and the design check stays green because the classes are still defined and named. If you want that note in docs/DESIGN.md itself, say so and I'll add it.

commented

The connect rows now lead with the caret, and the key, GitHub and Forgejo glyphs sit in the title beside each name. They no longer rotate when a row is open. tsc, test/design-lint.test.ts, test/web-origins.test.ts and test/origins-oauth.test.ts pass (57 tests). I haven't seen the page rendered, since the sandbox has no browser.

  • Caret and glyph: connectPath in src/web/pages/origins.ts now takes chevronRight as the lead, as /map's lanes do. The three rows are visibly foldable again.
  • Tests: a new test in test/web-origins.test.ts renders /settings/origins and /settings/origins?host=codeberg.org. For each of the three folds it checks that the lead is the caret and not the brand glyph, and that the glyph is in the title. It would fail if the lead went back to the brand icon.
  • Open state: the same test checks the open state of each fold. Without a host the token fold is open and the GitHub and Forgejo folds are closed. With ?host= (which sets mode to host) all three are open.
  • Token row: it is open by default but still collapsible, and that is intentional. It is the same <details> as the other two, and collapsing it only hides the form. Making it unfoldable would need a non-folding row, which §5 doesn't offer. Say so if you want that instead.
  • Line length: no formatter is installed here (there is no prettier or biome in the repo or node_modules), so I wrapped the lines I added by hand: the qrSvg call and the footer text. Other lines in the file were already over 80 columns before this change and I left them alone.

Part two is still #4155. docs/DESIGN.md is untouched.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs