mirror of
https://github.com/bitbaum/accountkit.git
synced 2026-12-04 05:17:14 +01:00
Each product wrote its own account menu, and each learned half of what
the other had:
Loki AccountMenu OrangeCat UserProfileDropdown
initials from the name only never rebuilds a name from the email
custom rows (Appearance) photo with a fallback, arrow keys
36px trigger 44px trigger
name falls back to the —
email local-part
and Loki's public pages had no menu at all, so a signed-in person could
not find sign-out (loki#870 papered over that by reusing the app's menu).
This is the one menu with both halves. It knows nothing about how a
product signs people in — NextAuth, Supabase, better-auth all pass the
person, the places, and a sign-out function — and keeps routing with a
renderLink seam (Next <Link>; a plain <a> by default).
Shared and not configurable, because each shipped broken somewhere:
- the name is never built from the email (OrangeCat's rule; Loki broke it)
- initials only from the name; else a person glyph
- a broken photo falls back to initials
- 44px trigger and rows; the panel never runs off a 390px screen
- Escape closes and returns focus wherever focus was
- sign-out says it is happening, and says when it FAILED (menu stays open)
The real-browser check caught a bug before release: Escape did nothing
after a MOUSE open, because the handler sat on the panel and focus was
on the trigger. It is now a document listener while open.
Styled from @bitbaum/design-tokens through --acct-* variables at zero
specificity (chatkit's pattern), so an app's own :root wins and an OKLCH
app maps its tokens once.
dist/ is committed so `github:bitbaum/accountkit#v0.1.0` installs with no
build and no allowBuilds entry; CI fails if it drifts from the source.
verify: format, lint, types, build, 13 unit+render tests, browser checks
at 390px light and dark. Proved by mutation — letting the name fall back
to the email local-part fails "a name is NEVER reconstructed from the
email address".
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
# Re-arm strand: a GITHUB_TOKEN merge starts no workflow on its own, so the
|
|
# auto-merge sweep must be able to start CI on main explicitly.
|
|
workflow_dispatch: {}
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
# pnpm version comes from "packageManager" in package.json (SSOT).
|
|
- uses: pnpm/action-setup@v6
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: "24"
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
# The browser check drives a real Chromium — the only way to prove the
|
|
# touch target is 44px, Escape closes the menu, and nothing overflows at
|
|
# 390px, in light and dark.
|
|
- run: pnpm exec playwright install --with-deps chromium
|
|
# Identical to what runs locally: format, lint, types, build, unit +
|
|
# render tests, browser check.
|
|
- run: pnpm run verify
|
|
# dist/ is committed so a `github:` install needs no build step (pnpm 11
|
|
# refuses git-dependency builds without a per-SHA allowBuilds entry in
|
|
# every consumer). It must be exactly what the source builds to.
|
|
- name: Committed dist/ matches the source
|
|
run: git diff --exit-code --stat -- dist
|