Repository navigation
feat(ui): rail every sidebar · hide unavailable paid features · Read-by-default - #10
Conversation
…-default UI-consistency pass (wiki-v2 UI audit). Three root-cause fixes to upstream seams: - Rail-every-sidebar (#1/#2): getSidebarCollapseState now rails ALL navbar sidebars on collapse (home/settings/space/AI) so none slide off-screen. New space + AI-chat rails (collapsed prop + railHidden CSS); dimensions come from a new CCC-owned features/layout token module (shared with the console). - Hide-don't-advertise (#4): a new CCC-owned features/feature-availability gate; fold feature-availability into the settings-nav show check and hide every paid/EE control that was rendered disabled with an "Available with a paid license" tooltip (Templates, Bases/Kanban, DOCX/PDF/Confluence import, DOCX export, comment Resolve, page verification, MFA, space security, workspace toggles). Drops the useUpgradeLabel affordances on those surfaces. - Read-by-default (#5/#6): pure resolvePageEditMode helper (user pref > workspace default > Read) + Read-default atom/preference; the workspace General page is gated on the Docmost manage-settings ability (platform admins manage workspace settings in the console) and the default-edit-mode control warns before Edit. New/changed upstream seams documented in UPSTREAM_MODIFICATIONS.md (#64–#82, plus refreshed #34/#36/#38/#40/#41/#51). New pure helpers carry regression tests. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Performance ReviewReviewer: Performance Reviewer (Claude Opus 4.8) SummaryNo Performance findings on this side at HEAD What I checked (render paths, atoms, memoization)
Nothing here plausibly costs real time, memory, or render churn at realistic sizes. |
🏛️ Architecture ReviewReviewer: Architecture Reviewer Summary: The fork side is a large, disciplined "hide-don't-advertise + rail-every-sidebar + Read-by-default" pass. Layering is clean (pure, unit-tested Findings[Minor] — Abstraction boundaries —
|
|
DevOps / Operations / Reliability Reviewer (Claude Opus 4.8) — reviewed jointly with super PR cccvu/wiki-v2#151. No DevOps/Reliability findings on this side at HEAD |
🔒 Security Review — fork side (coupled with super
|
🧪 Test Review — QA Engineer's EyeReviewer role: Test Reviewer
Verdict💬 Comment Adequately tested to merge. The three new fork tests ( SummaryThe change (a) reduces Findings🟡 Minor —
|
| Behavior / branch | Covered? | Test that guards it |
|---|---|---|
Home/global rails on collapse (showGlobalSidebar:true, isRail per toggle) |
✅ | sidebar-collapse.test.ts HOME (full toEqual) |
Settings rails, never hides (showGlobalSidebar:false) |
✅ | SETTINGS case |
| Space page-tree rails, never hides | SPACE case — showGlobalSidebar unasserted (Minor) |
|
| AI chat rails, never hides | AI case — showGlobalSidebar unasserted (Minor) |
|
isRail true only when desktop toggle off |
✅ | "isRail is true only when…" loop over all 4 routes |
| Every navbar sidebar rails | ✅ | "every navbar sidebar rails" loop |
| edit-mode: explicit user Edit/Read wins | ✅ | resolve-page-edit-mode.test.ts cases 1–2 |
edit-mode: null/undefined user → workspace default |
✅ | case 3 |
| edit-mode: neither set → Read fallback | ✅ | case 4 |
| edit-mode: both invalid → Read | ✅ | case 5 |
| edit-mode: invalid user + valid workspace → workspace | ❌ | none — see Minor |
| FeatureGate: available → children | ✅ | feature-gate case 3 |
| FeatureGate: unavailable → hidden | ✅ | case 4 |
| FeatureGate: unavailable → fallback | ✅ | case 5 |
| FeatureGate: available ⇒ fallback absent | ❌ | none — Question (trivial) |
| slash-menu gated-item filter / flat-index alignment | ❌ | none — see Minor |
~9 hand-rolled hasFeature && … hides (mfa/verify/comment/import/export/…) |
❌ | none — Question |
What I checked
- Behavior coverage — each new pure/primitive branch has a test that would fail if it regressed (two secondary branches don't; noted)
- Edge cases and boundaries — null/undefined/garbage/empty covered for edit-mode; invalid-user+valid-ws missing
- Failure modes — n/a for these pure functions/render guards
- Assertions are meaningful — verified the sidebar/edit-mode assertions go red under plausible mutations;
showGlobalSidebarfor space/AI does not - Tests aren't brittle — no time/order/network/float coupling;
feature-gatemocksuseHasFeatureand cleans up per-test (good) - Regression resistance — the core "no sidebar hides" and "Read-by-default" invariants are pinned; slash-menu index is not
- Test design / maintainability — clean; truth-table + precedence tables read well
Priority mapping (for the review loop)
All findings are optional (none merge-blocking — the current code is correct; these are regression-resistance / edge gaps). Priority Level 1–5, 5 highest:
- L3 — slash-menu
visibleItemsfilter / flat-index alignment untested (new logic, keyboard-nav desync class) - L2 —
showGlobalSidebarunasserted for space/AI cases (double-render regression survives) - L2 — invalid user pref + valid workspace default fallthrough untested
- L2 — hide-doctrine verified only at the
FeatureGateprimitive, not the ~9 hand-rolled call-sites (+ untested data-fetch gating in mfa/verification) - L1 —
FeatureGatedoesn't assert fallback-absent when available
Open questions for the author
railsWhenCollapsedis now a tautology ((!s&&!set&&!ai) || set || s || ai≡truefor all inputs), so thecollapsed.desktop = railsWhenCollapsed ? false : !desktopOpened"hide" branch inglobal-app-shell.tsxis dead. Intentional? If a route ever should hide again, the current tests would not distinguish it — worth a one-line comment so the next editor knows the table has no "hide" row by design.
🐛 Correctness Review — Bug HunterReviewer role: Correctness Reviewer Verdict🔴 Request changes (one Major, reachable rendering bug on the space route; two optional/latent items) The three pure helpers ( SummaryI traced the edit-mode precedence, the rail-vs-hide truth table, every feature-gate leaf, and the slash-menu index math. Findings🟠 Major — Space-route navbar width collapses the mobile overlay to the 52px rail
🟡 Minor (latent) — Conditional hook call via
|
🎨 Frontend / UI / UX ReviewReviewer: Frontend / UI / UX Reviewer Summary: This is a clean, well-executed UI-consistency pass. The "rail every sidebar" change renders correctly (icons centered, no clipping, good light/dark contrast), the hidden tree/switcher are correctly removed from the tab order in rail mode, keyboard focus is visible on every rail (I verified this live — see note under Q4, it disproved my one candidate a11y finding), and Read-by-default genuinely gates the editor ( Findings4. Will it work for everyone, on any device?[Minor] — Design-system adherence / focus consistency —
|
…ks-safe gate, tested slash filter PR #10 review fixes (coupled with wiki-v2 PR docmost#151): - BLOCKER (Correctness): the space-route navbar width was a plain number applied at every breakpoint, so a below-`sm` viewer who had collapsed the desktop sidebar got a clipped 52px mobile overlay with the full tree still rendered. Make `base` responsive on every route (full-width overlay below sm; rail/resizable only at sm+), mirroring the non-space branch and the console's isDesktop-gated rail. - L3 (Correctness): settings-modal computed space-security availability as `useFeatureAvailable(A) || useFeatureAvailable(B)`, which short-circuits the second hook (Rules-of-Hooks violation if entitlements change between renders). Add a `useSpaceSecurityAvailable()` composite in the feature-availability module that calls both hooks unconditionally; the parent tab-gate now uses it. This also gives the module a real multi-entitlement predicate (Architecture: the passthrough now centralizes a genuine rule) and the doc no longer over-claims a "single seam". - L3 (Testing): extract the slash-menu visibility filter into a pure, unit-tested `getVisibleSlashItems` helper and delegate command-list.tsx to it — covers the flat-index-matches-render invariant (the one real logic change in the slash menu). Seams #83/#84 documented in wiki-v2 UPSTREAM_MODIFICATIONS.md; boundary check green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Review round 1 — addressed (fork PR 10 @
|
Performance Re-review (round 1 fixes)Reviewer: Performance Reviewer (Claude Opus 4.8) Verdict: Approve — no Performance findings at HEAD
|
🔒 Security Re-review (round 1) — ✅ No new Security findings on the fork side at HEAD
|
🎨 Frontend / UI / UX Re-review (round 1 fixes)Reviewer: Frontend / UI / UX Reviewer · Model: Claude Opus 4.8 What moved in my lane — dispositions✅ RESOLVED (net improvement) — mobile-overlay width, Below ✅ RESOLVED — slash-menu keyboard-nav (was deferred to Correctness). The visibility filter is extracted to a pure, unit-tested Prior optional items (deferred to docmost#153) — unchanged, still Level ≤2
No new frontend/UX findings introduced by the fixes on this PR. |
🏛️ Architecture Re-review (round 1 fixes)Reviewer: Architecture Reviewer Summary: The round-1 fixes land cleanly. The Prior findings — status✅ RESOLVED — L3 — ✅ RESOLVED — L2 — space-security availability rule duplicated across parent/child. Regression hunt (Architecture lane) — clean
No merge-blocking or Level-3+ Architecture findings remain on the fork side.
|
🐛 Correctness Re-review (round 1) — Bug HunterReviewer role: Correctness Reviewer Verdict✅ Approve (Correctness lane) — my one merge-blocking finding and my L3 latent finding are both fixed; the extraction is behavior-preserving; no new correctness issue introduced. Re-check of prior findings✅ FIXED — 🟠 Major: space-route mobile overlay collapsed to 52px
width: {
base: SIDEBAR_WIDTH,
sm: isRail ? RAIL_WIDTH : isSpaceRoute ? sidebarWidth : SIDEBAR_WIDTH,
}Traced all four cases:
No regression to the desktop rail or the drag-to-resize: ✅ FIXED — 🟡 (L3 latent) Rules-of-Hooks via
|
🧪 Test Re-review (round 1 fixes) — QA Engineer's EyeReviewer role: Test Reviewer · Model: Claude Opus 4.8 Verdict✅ Approve (Testing lens) — my one fork L3 is resolved; no regressions in the new/changed tests; remaining items are all non-blocking Level ≤2 polish. Prior findings — status✅ RESOLVED — slash-menu filter untested (was L3)The gated-item filter is extracted to a pure
Still open (non-blocking Level ≤2 — correctly deferred; not re-raising to block)
Regression huntNo new fork test regressed; the slash-menu change is net-negative risk. No new untested logic introduced on the fork side this round. Re-review conclusion: all round-justifying (L3+) Testing findings on the fork side are resolved. The four items above are Level ≤2 polish for the follow-up issue. |
|
DevOps / Reliability Reviewer (Claude Opus 4.8) — re-review at HEAD Still no DevOps/Reliability findings on this side. The round-1 fork delta ( |
TL;DR
The wiki half of the UI-consistency pass (tracked in cccvu/wiki-v2 issue 149; paired with the super-repo PR that bumps this submodule). Three root-cause fixes to the fork client: rail every sidebar (none slide/vanish), hide unavailable paid features (don't advertise them), and Read-by-default page open mode.
What this does
getSidebarCollapseStatenow rails ALL navbar sidebars on collapse (home/settings/space/AI) to the 52px icon rail — none use Mantine's hide, which slid the navbar off-screen. New space + AI-chat rails (collapsedprop →data-collapsed+railHiddenCSS, mirroring the global/settings rails); the space resize handle hides while railed. Dimensions come from a new CCC-ownedfeatures/layout/layout-tokens.ts(shared with the console via a drift test in the super-repo).features/feature-availability/gate (FeatureGate/useFeatureAvailable). The settings-nav show-check folds in feature-availability (hiding a nav item also makes its EE page unreachable). Every remaining paid leaf is hidden instead of disabled: Templates (both sidebars), editor Bases/Kanban, DOCX/PDF/Confluence import, DOCX export, comment Resolve, page-verification badge+menu, MFA row, space-security toggles, workspace toggles. Drops theuseUpgradeLabelaffordances.resolvePageEditMode(userPref, workspaceDefault)helper — precedenceexplicit user pref > workspace default > Read— plus a Read-default atom/preference, so pages open read-only. The wiki Workspace General page gates its editable admin controls on the Docmost manage-settings ability (role: "admin"on the nav item), so non-privileged platform admins no longer see 403-throwing controls (they manage workspace settings in the console — super-repo side); its default-edit-mode control warns before Edit.Why
Merge
b3e64af(fork PR 5 + super PR 124) added the icon-rail pattern to only some surfaces and left paid-feature UI greyed. See cccvu/wiki-v2 issue 149 for the full context, rationale, and the rejected alternatives (notably: NOT elevating the shadow user's Docmost role — the platform, not Docmost roles, is the auth authority).How it works
All genuinely-new logic lives in boundary-excluded CCC dirs (
features/layout/,features/feature-availability/) or pure helpers (sidebar-collapse.ts,resolve-page-edit-mode.ts); the upstream edits are minimal per-surfacehasFeature && …/return nullguards + rail plumbing. Every intentional upstream edit is documented inUPSTREAM_MODIFICATIONS.md(#64–#82 new, #34/#36/#38/#40/#41/#51 refreshed) — the boundary check is green.Testing
pnpm --filter client test— 151 pass (new:sidebar-collapsetruth-table extended,resolve-page-edit-mode,feature-gatebehavior).pnpm --filter client tsc --noEmit— 0 errors (after building@docmost/editor-ext).scripts/check-upstream-boundary.sh(super-repo) — green.Risk & rollback
Presentation + client-gating only — no server/authz change on the fork side (server re-enforces every permission; the feature-hiding is advisory UI). Rollback = revert the merge. The rail behavior is guarded by
sidebar-collapse.test.ts; the boundary check guards the seam set.🤖 Generated with Claude Code