Skip to content

Editorial UI refresh + local-dev QoL (frontmatter, mermaid zoom, filterable branches, env passphrase, discoverBranches) - #2

Closed
pwalus wants to merge 7 commits into
vaimo:masterfrom
pwalus:feat/editorial-refresh
Closed

Editorial UI refresh + local-dev QoL (frontmatter, mermaid zoom, filterable branches, env passphrase, discoverBranches)#2
pwalus wants to merge 7 commits into
vaimo:masterfrom
pwalus:feat/editorial-refresh

Conversation

@pwalus

@pwalus pwalus commented Aug 28, 2026

Copy link
Copy Markdown

Bundles the design + local-dev iterations I've been running against a Byredo docs deployment. Everything new is either purely additive (UI, frontmatter, mermaid zoom) or env-gated so existing deployments are unaffected until they opt in.

Summary

  • Editorial UI refresh — warm cream paper + near-black ink + ochre accent; Fraunces (variable serif) + DM Sans + JetBrains Mono loaded via `next/font`. Split editorial sign-in cover, ink-on-paper masthead, sidebar that auto-expands + pretty-names files/folders + highlights the current page with a checkmark and ochre band. Coloured mermaid palette. Ruled editorial tables. Dark-ground code blocks.

  • Frontmatter rendering — YAML frontmatter is now parsed via `gray-matter` and rendered above the article as an "At a glance" block: serif title, italic description, metadata grid with tag chips + formatted dates + status badges, and full-width one-per-line sections for long arrays (`related`, `applies_to`). Duplicate `# Title` in the body is stripped when it matches frontmatter's title.

  • Mermaid: fullscreen zoom + per-participant colour — `Zoom` button opens a portal-rendered overlay with wheel-zoom, drag-pan, HUD, and Escape-to-close. Actor rects in sequence diagrams and node shapes in flowcharts get cycled through a distinct palette post-render so multi-actor diagrams read at a glance.

  • Filterable branch switcher — search input at the top of the dropdown, case-insensitive substring filter, match highlighting, current branch pinned, Enter selects the first non-current match, Escape clears then closes.

  • `discoverBranches: true` — new top-level config flag; when set, the config loader calls `repos.listBranches` for `DOCS_REPO` and merges every branch into `config.branches`. Explicit `branches:` entries stay in place and act as templates for permissions/comments/chat. Fails soft.

  • `PROJECTPAGES_PASSPHRASE_` env override — per-user-group passphrase can now be set in the environment (`vaimo` → `PROJECTPAGES_PASSPHRASE_VAIMO`, etc.). Env value wins when non-empty; config passphrase remains a fallback. Real secrets no longer have to live in the docs repo.

  • `PROJECTPAGES_LOCAL_CONFIG` — local-dev backdoor to load `projectpages.config` from a filesystem path instead of the GitHub API. Nothing needs to be committed to the docs repo for local iteration.

  • `DEV_AUTH_BYPASS=1` — local-dev backdoor to skip the passphrase check and log in as the first user group. Env-gated, off by default.

  • Docs — README + all `docs/` pages updated for the above (authentication, configuration, deployment, content-rendering, design, project-structure).

Test plan

  • Existing deployments (no new env vars set, no config changes) render identically apart from the visual refresh — no functional regressions.
  • Sign in with a real passphrase via config's `userGroups[].passphrase`.
  • Sign in with `PROJECTPAGES_PASSPHRASE_` set; verify env value wins.
  • Sign in with `DEV_AUTH_BYPASS=1`; any input logs in as the first group.
  • Set `PROJECTPAGES_LOCAL_CONFIG=/abs/path`; verify config loads from disk and no GitHub API call fires for the config.
  • Set `discoverBranches: true`; open the branch switcher — every remote branch appears.
  • Type in the branch switcher search box; verify substring match + highlight; current branch stays pinned.
  • Open a `.md` file with YAML frontmatter; verify the "At a glance" block renders with title, description, tags, related list; body's `# Title` is stripped when it matches.
  • Open a doc with a mermaid diagram; verify actor/node colours cycle; click Zoom; scroll to zoom, drag to pan, Escape closes.
  • Sidebar: pretty names show (no `.md`, underscores → spaces, acronyms preserved). Folder containing the active file is auto-expanded.
  • All existing routes still authenticate correctly; comments still scoped by `(file_path, branch)`.

Notes for reviewers

  • `app/globals.css` has `!important` on the list-marker rules because Tailwind v4's preflight resets `list-style: none` in `@layer base` and (in this Turbopack build) that wins over an unlayered rule. If that quirk gets fixed upstream, the `!important` can come out.
  • The frontmatter Markdown renderer preserves the pre-refresh signature — `renderMarkdown()` still returns just the HTML string. New callers can use `renderMarkdownWithFrontmatter()` for the `{ html, frontmatter }` shape.

🤖 Generated with Claude Code

pwalus-vaimo and others added 7 commits August 28, 2026 12:46
UI / design
- Editorial Vaimo × Byredo palette (warm cream paper, near-black ink,
  ochre accent). Fraunces (variable serif) + DM Sans + JetBrains Mono
  loaded via next/font.
- Sign-in redesigned as a split editorial cover; nav becomes an ink-on-
  paper masthead with a monogram; sidebar gets a "Contents" masthead
  and auto-expands + scrolls to the currently-viewed file, which is
  now marked with a full ochre-tint band, thicker accent border, and
  a checkmark. Sidebar file/folder rows are pretty-named (underscores
  and hyphens turned into spaces, .md dropped, acronyms preserved).

Frontmatter
- gray-matter now parses YAML frontmatter into a structured
  "At a glance" block: serif title, italic description, grid of
  scalar metadata, dedicated tags row, and full-width one-per-line
  list for long arrays (e.g. related, applies_to).
- Duplicate # Title in the body is stripped when frontmatter has
  a matching title.

Mermaid
- Themed to the palette; per-participant colour cycled across actor
  columns (matched top/bottom) and flowchart nodes via inline style
  with !important to defeat mermaid's compiled CSS.
- Fullscreen zoom overlay via createPortal (escapes the article's
  transform-containing-block created by the fade-up animation) with
  wheel-zoom, drag-pan, HUD, and Escape-to-close. SVG is resized to
  fill 88vw x 84vh.

Prose
- Restored native list markers (Tailwind v4 preflight zaps them; the
  fix uses !important because unlayered styles didn't win over the
  layered reset in this Turbopack build). Ochre marker colour.
- Fraunces headings with optical sizing, ruled tables with uppercase
  sans headers, dark-ground code blocks with warm syntax colours,
  serif-italic blockquotes.
- Removed the .prose 780px cap so the article fills its column.

Header / metadata
- Removed the "File / <name>.md" block from view pages; breadcrumbs
  are pretty-named, and the "Updated <date> - <author>" line moved
  to the top-right of the header row alongside the download buttons.

Local-dev backdoors (env-gated, default off — no prod impact)
- PROJECTPAGES_LOCAL_CONFIG=<path> in lib/github.ts: read
  projectpages.config from disk instead of the GitHub API.
- DEV_AUTH_BYPASS=1 in lib/auth.ts: skip the passphrase check and
  log in as the first configured user group.
- .gitignore: projectpages.config.local (sibling of the local env
  file convention).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a `discoverBranches: true` top-level flag to projectpages.config.
When set, the config loader calls repos.listBranches for the docs repo
and merges every branch into `config.branches`. Explicitly listed
branches keep their permissions; discovered branches inherit the first
explicit entry as a template.

Fails soft — if the API errors, we log and fall back to the declared
list so the app keeps working.

Motivation: teams that just want every branch of their docs repo to
appear in the BranchSwitcher shouldn't have to hand-list them in the
config every time a new branch lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The branch dropdown gains a search box at the top: typing filters
the list by substring (case-insensitive) and highlights the match.

- Current branch is always pinned first even when it doesn't match
  the query — you can always see where you are.
- Enter selects the first non-current match.
- Escape clears the query, then closes on second press.
- Empty state shown when no branches match.
- Widened the dropdown to 280–360px so long feature/byr-*
  branch names don't get truncated too aggressively.

Also fixes a Rules of Hooks bug (useMemo was called after an early
return) by hoisting the memo above the guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- TopNav: replaces the V-monogram + eyebrow with the actual Vaimo
  logo (dark, ochre X + wordmark) followed by a hairline slash and
  the serif site title.
- Sign-in cover: replaces the V-disc with the white Vaimo logo on
  the dark left panel; site name reduced to "Project Pages".

Adds public/vaimo-logo-dark.png (the raster logo with a dark
wordmark — the SVG in the repo turned out to be white-fill only,
so it disappeared on the light navbar).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a per-user-group env override so real passphrases can live
in the deployment environment instead of the checked-in
projectpages.config (which sits in the docs repository and is
therefore not secret-safe).

Var name: PROJECTPAGES_PASSPHRASE_<GROUP_NAME> — the group name
is upper-cased, non-alphanumerics become underscores. Examples:

  userGroup: vaimo            → PROJECTPAGES_PASSPHRASE_VAIMO
  userGroup: external-partner → PROJECTPAGES_PASSPHRASE_EXTERNAL_PARTNER

Precedence: env value wins when set and non-empty; otherwise the
config value is used unchanged. An accidental unset does not
silently lock everyone out — the config value is still honoured.

Teams can now commit projectpages.config with blank passphrase
strings (or placeholder text) and set the real secret only in the
deployment's environment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Reframes "how it works" step 2 around user groups (not per-branch
  passphrases), and mentions env-var passphrase overrides.
- New "Features" section highlighting the editorial UI, frontmatter
  rendering, filterable branch switcher, and coloured mermaid zoom.
- New "Quick start (local, no config in the docs repository)" section
  covering the local-dev flow: PROJECTPAGES_LOCAL_CONFIG +
  PROJECTPAGES_PASSPHRASE_<GROUP> + optional DEV_AUTH_BYPASS.
- Documents the discoverBranches config flag.

The docs/ tree wasn't touched — deeper reference material still
lives in there and is linked from the same table.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- authentication.md: rewrites the passphrase flow around user groups
  (was per-branch), documents PROJECTPAGES_PASSPHRASE_<GROUP> env
  override, and DEV_AUTH_BYPASS. Corrects the sign-in diagram and
  JWT contents.
- configuration.md: adds env-var passphrase note to userGroups,
  adds the discoverBranches field with template-inheritance
  semantics, notes PROJECTPAGES_LOCAL_CONFIG in the intro.
- deployment.md: adds PROJECTPAGES_PASSPHRASE_<GROUP>,
  PROJECTPAGES_LOCAL_CONFIG, and DEV_AUTH_BYPASS rows to the
  environment-variables table.
- content-rendering.md: adds bullets for YAML frontmatter
  rendering and Mermaid zoom/colour; refreshes the sidebar
  description (pretty names, auto-expand, active-file band,
  drag-resize).
- design.md: full palette rewrite for the editorial tokens
  (paper/ink/rule/accent) with legacy-alias table; documents
  the Fraunces + DM Sans + JetBrains Mono type stack loaded
  via next/font.
- project-structure.md: adds new components (Frontmatter,
  MermaidBlock, BranchSwitcher, OutlinePanel) and updates the
  key-files table with the current lib/ responsibilities.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants