Skip to content

feat(core): unify signed-in pages on one app shell - #267

Merged
allisonmahmood merged 2 commits into
mainfrom
portal/254-component-set
Sep 16, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
portal/254-component-set

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

Company, Connections and Your machines used separate page treatments, so navigation and controls changed between signed-in pages.

They now share one app shell and one component set. Auth doors keep their card, / stays unchanged, and existing forms and permissions keep their behavior. The UI review spec and product glossary now document the shared controls.

Stacked on #266 (portal/253-cli-verbs), which is this PR's base. The diff contains only issue #254's shell and component work.

Closes #254.

Verification

  • Typecheck and lint passed.
  • Full offline suite: 877 tests across 79 files passed.
  • Final focused page suites: 57 tests passed after review corrections.
  • Exercised all four signed-in pages and form success/refusal paths through this worktree's dev instance; captured PNGs and checked 390px layouts.
  • Standards findings fixed and rechecked; no Spec findings remain.

Implemented with GPT-6 Astra in Oh My Pi.

@github-actions github-actions Bot added area:server Touches the server area area:core Touches the core area area:docs Touches the docs area size:m 100-500 changed lines labels Sep 15, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra review

Reviewed 538f0f3 against origin/portal/253-cli-verbs at f78ef9a, using issue #254 and its referenced §12 of #247. One pass, no subagents. Merge blockers only.

Standards

No merge-blocking method or YAGNI findings. The change keeps the existing server-rendered approach, puts the shared controls in html.ts, and removes the replaced page-specific treatments. The confirmation-form classes are explicitly requested by #254, not speculative scope.

Spec

No merge-blocking intent findings. Company, Connections and Your machines use the app shell with the requested navigation, marked section, viewer and sign-out. Auth doors retain the card. The diff preserves form actions and authorization, leaves the marketing page's behavior unchanged, and updates the UI review spec and Portal glossary.

Verification: all 60 tests across six focused suites passed: rendering, company pages, connection pages, device pages, auth pages and auth socket tests. A Chromium smoke check of the emitted shell found no horizontal overflow at 390px or 1280px; the mobile layout and keyboard focus transition were checked. The worktree dev instance was stopped, so I did not repeat the authenticated dev-instance screenshots.

Summary: Standards 0 blockers; Spec 0 blockers. No merge-blocking issue on either axis.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Two-axis review of 538f0f3 against origin/portal/253-cli-verbs (f78ef9a), plus #254 intent, the method, and YAGNI. Spec source is issue #254.

Standards

No Effect-service findings. First-party pages compose htmlPage and the named classes. Doors stay on the card. Patches stay out of htmlPage. Product glossary and docs/product.md match.

Page CSS still owns component spacing (.agents/skills/ui-consistency/SKILL.md: page CSS is layout only; the shell owns component spacing). Judgement, not a hard size/radius/colour override.

packages/companies/src/Join.ts 30–33: after composing list-row, page CSS zeros its paragraph margin:

.join-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.join-invite p { margin: 0; }

Flex on .join-invite is layout. .join-invite p { margin: 0 } overrides .list-row p. Put the Join control in .actions, or add one shell layout class.

packages/integrations/src/ConnectionPage.ts 52–57: .connection-calls summary { margin: 12px 0 } is leftover spacing. .connection-sql { max-height: 18rem; white-space: pre-wrap; overflow-wrap: anywhere } overrides shared pre height and wrapping. Move those into html.ts. Leave only flex/nowrap layout here.

Loosened structure assertion. packages/auth/src/DevicePages.test.ts 87 now matches any h1, not verification-code. Restore class="verification-code".

AppShell is not a public type. It is exported from html.ts but not from packages/core/src/index.ts (htmlPage only). Callers reconstruct it:

  • packages/auth/src/page.ts 11: app?: Parameters<typeof htmlPage>[0]["app"]
  • packages/integrations/src/ConnectionPage.ts 27–29: Parameters<typeof pageResponse>[0]

Export AppShell from @patchy/core and type Page.app with it.

Speculative generality. AppShell["section"] includes null; no caller passes it. Drop null. "patches" stays. It is the nav item.

Dead class. connection-form remains on three forms with no CSS after .connection-form button was deleted. Drop the class.

Confirmation-form / note-refused CSS is unused, but the issue, the review spec, and the glossary require that set. Not a smell.

Spec

Missing or partial

Connection page CSS is not layout-only. Spec: "their page CSS keeps layout only." Company and machines dropped page CSS. ConnectionPage.styles still sets .connection-calls summary { margin: 12px 0 } (spacing) and .connection-sql { max-height: 18rem; white-space: pre-wrap; overflow-wrap: anywhere } (height/typography on shared pre). Flex/nowrap on status/time are layout. Those two rules are not.

Confirmation-form classes are styled and unused. Spec: "the confirmation form (consequence, list, acknowledgement, submit and cancel), each a named class styled once." .confirmation-form / -consequence / -list / -acknowledgement / -actions exist only in html.ts. No page composes them. That matches "Nothing new is served" (portal confirmations are later), not a missing page.

Otherwise the asked set is present, including unused checkbox/radio/textarea/note-refused. /company, connections list (connect form on it) and detail, and /machines pass app plus shared btn/field/list/facts/note/pill/section-heading. / (render.ts) and packages/core/fixtures are untouched. Doors (sign-in, join, device confirm, deactivated, errors(), shell notices) stay on .auth-card. pageResponse takes app: { viewer, section }. render.test.ts covers header-then-main, the four nav links, one aria-current, and viewer/company escaping. Glossary and product sentences match "from decided to built." ui-consistency gained the app shell, the set, and the no-local-button/field/list/notice/heading rule.

Scope creep

No extra routes or confirmation UX. Restyling join, the sign-in door, device confirm, and renderShellNotice to page-heading/btn follows "a first-party page introduces no button, field, list, notice or heading style of its own" after .auth-card h1 / .auth-action were removed. note-ok and supporting-text are not in the issue's notice/field list. They lift treatments connections already had so those pages would not keep their own notice/meta styles.

Looks implemented, looks wrong

Page-level height/typography override vs the review spec this PR writes. Spec: "makes a page-level override of a component's size, radius or colour a finding." .connection-sql's max-height / white-space / overflow-wrap override shared pre on the connections detail page.

Connections suite does not prove the shell. Spec: "the company, connection and machines page suites pass on the new shell." Company and machines tests require action="/logout" after signOutForm() was removed from those bodies, so they fail without the app bar. ConnectionPages still does content.app ? content.body : body+signOutForm(), so the connections suite's logout assertion (ConnectionPages.test.ts 353) still passes on the card.

Intent (#254)

A signed-in person should stop feeling like Company, Connections, and Your machines are three different sites. Same header, same controls, same scale. Doors stay a card. / stays marketing until the portal. Nothing new to use. Invite, revoke, connect, disconnect still do the same things.

The PR delivered that. Chrome changed on purpose. Forms and permissions did not.

Silent chrome, same POSTs:

  • Destructive actions now use btn-danger. Deactivate, Revoke invite, Disconnect, Delete, Revoke all used to look like every other blue auth-action. Same one-click POST, now amber.
  • Company's in-page Connections link is gone. Header nav replaces it. Detail pages keep the crumb.
  • Patches → / is specified. Until the portal, that nav item dumps a signed-in person onto marketing. Awkward, admitted, not a miss.
  • Sign-out moved from page footer to the header on app pages. POST /logout is unchanged. Doors still footer-sign-out.
  • Connection/session/sql error pages stay on the card, as specified. Happy-path connections have the shell. An unavailable error drops chrome. Company form refusals stay in the shell.

Glossary follow-through matches decided → built: packages/portal/CONTEXT.md, the docs/product.md paragraph, and ui-consistency as a hard rule against page-owned control styles. Fixtures unchanged.

Ready to close #254 after the Connections leftover and page CSS. The Patches dead-end is ticket 8.

Method

Mostly right. This is the smallest durable contract, with one leftover adapter that should have been deleted.

app?: AppShell on htmlPage is the mode. Two functions would copy the document chrome. Presence of app is the switch (html.ts 21, 499). AppShell as a name-only nested subset (html.ts 1–7) is correct: core must not import Auth's Viewer, and structural typing is the point. pageResponse injecting the heading (page.ts 64, 71–73) while appBody wraps <main> is the right landmark split. Named classes, not HTML helpers. The spec forbids a library.

The leftover is Connections. Company stamps chrome at the route (AuthPages.ts 53). Connection content sets app (ConnectionPage.ts 124, 153) and the route keeps content.app ? content.body : body+signOutForm (ConnectionPages.ts 37). The handle catch (ConnectionPages.ts 20–26) omits app, so "Connection unavailable" is still a card with a bolted-on sign-out. Stamp app at ConnectionPages the way company does. Content emits body only. Delete the ternary.

ConnectionPage.Page = Parameters<typeof pageResponse>[0] is how that happened: content now owns heading/styles/app. CompanyPage.Page is still title/body/status. Keep that. Optional app belongs on htmlPage (marketing has no chrome). On a signed-in route, forgetting it silently selects the door wrap.

Confirmation/checkbox/radio CSS with no consumer is the spec's vocabulary for later confirmation pages, not extra machinery. Dual CSS worlds in html.ts stay until / dies. Splitting the string would be ceremony. Tests in serving/src/render.test.ts match the spec's own test home.

YAGNI

Delete:

  • Restore class="verification-code" in DevicePages.test.ts. The rename was device-code → verification-code. The test now matches any <h1>.
  • Drop null from AppShell.section. Nothing passes it.
  • Drop the dead connection-form class.
  • Export AppShell from @patchy/core. Stop reconstructing it with Parameters.

Judgement:

  • confirmation-* (and field-choice / field-checkbox / field-radio, textarea.field, note-refused) are specified and unused. Extra names for a form that does not exist yet, but the ticket listed them.
  • htmlPage tests live in serving because the ticket named render.test.ts. htmlPage is in core. Fine for this ticket.
  • page.heading stays. DevicePages is the one consumer so the user-code can be the <h1>. Do not add a second heading path.

No new component library. No one-consumer design system beyond the shell the ticket asked for.

Summary

Standards: 6 findings. Worst: connections page CSS still owns pre size and list-row spacing, against the review spec this PR writes.

Spec: 2 real gaps (layout-only CSS, connections suite still passes on the card). Worst: the connections suite does not prove the shell.

@allisonmahmood

allisonmahmood commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner Author

Reviewed both conversation comments, the Reviews tab, and inline review comments. The latter two are empty. Astra reported no blockers; the second review identified the issues addressed below.

Fixed

  • Removed Join's paragraph-margin override. Join now uses the shared list-row spacing and keeps only its flex layout.
  • Moved SQL wrapping/height into the shared code-panel class and disclosure spacing into the shared list-row summary rule. Connections CSS now contains only status/time layout. Documented the shared code panel in the UI review spec.
  • Moved Connections shell selection into ConnectionPages. Successful pages and inline form refusals always receive the Connections navigation. ConnectionPage.Page contains only content, status and redirect fields; the content-dependent sign-out ternary is gone.
  • Exported AppShell from @patchy/core, used it directly for Page.app, and removed the unused nullable section option.
  • Removed all four dead connection-form attributes and the obsolete connection-calls list class.
  • Strengthened the existing Connections suite to check primary navigation, the marked Connections link and exactly one sign-out on both list and detail pages for admins and members. It also checks that inline connection failures retain navigation and cross-company not-found errors do not acquire it. The SQL escaping assertion no longer pins a presentation class.

Kept as is

No API, CLI, authorization, migration, dev-loop, or product-lifecycle contract changed. This PR remains stacked on #266 with base portal/253-cli-verbs.

Verification

Pushed 719aa8d with these fixes.

  • pnpm typecheck and pnpm lint passed.
  • Six focused suites passed, 60 tests total: Connections, Company, Device, Auth, Auth socket, and Serving rendering. They cover connection lifecycle mutations, admin/member access, cross-company isolation, shell selection, auth doors and escaping.
  • Chromium checked the emitted shared components at 390px and 1280px: no page overflow, keyboard expansion works, long SQL wraps and scrolls inside the 288px panel, and Join uses shared list spacing. Screenshot: /tmp/foreman/254/shots/review-components.png. This was a component smoke check, not a repeat of the earlier authenticated dev-instance screenshots.
  • All eight configured PR checks passed on latest head 719aa8dd4e612c9580f0e773c069896052ace2d5: Node 22 tests, Node 24 tests, Postgres concurrency, CLI smoke, Clerk live, lint, dependency review, and PR labels. CI run. The stacked base has no configured required-check policy.
  • GitHub reports MERGEABLE and CLEAN, with no new review feedback after the push. No unresolved blockers. Ready to merge into the requested stacked base, portal/253-cli-verbs; not merged.

@allisonmahmood
allisonmahmood force-pushed the portal/254-component-set branch from 719aa8d to d65d618 Compare September 16, 2026 16:00
Base automatically changed from portal/253-cli-verbs to main September 16, 2026 17:00
@allisonmahmood
allisonmahmood force-pushed the portal/254-component-set branch from d65d618 to 1cc2152 Compare September 16, 2026 17:00
@allisonmahmood
allisonmahmood merged commit d50b295 into main Sep 16, 2026
8 checks passed
@allisonmahmood
allisonmahmood deleted the portal/254-component-set branch September 16, 2026 17:09
allisonmahmood added a commit that referenced this pull request Sep 16, 2026
People had to find patches through shared links and use the CLI for
routine management. The signed-in portal now lists the company's patches
and gives members, owners and admins the appropriate card controls.

Description, sharing, rollback and restore forms check for stale state
before making changes. Cards include retained versions, lifecycle
notices and the shared app shell.

Stacked on `portal/254-component-set` via #267, not directly on `main`.

Closes #255.

Retire, Delete, Reassign and off-source Restore links intentionally
return app-shell 404s until the follow-on confirmation pages land. This
amends the unmerged `0008` migration; existing disposable dev databases
need a reset, as documented.

## Verification

- Typecheck and lint pass. Final Portal/Serving tests pass: 46/46.
- One full `pnpm test` run had 893 passes and four database timeouts.
The three affected files passed serially, 12/12, with unchanged
timeouts.
- Verified the populated index, owner card, description save and two-tab
stale refusal in the worktree dev browser. Saved both requested PNGs and
checked the narrow layout.

Implemented with GPT-6 Astra in Oh My Pi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Touches the core area area:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): one component set and one app shell for every signed-in page

1 participant