Skip to content

feat(code): default-on Code surface, github→code tab alias (cave-m6ys)#3732

Merged
BunsDev merged 1 commit into
mainfrom
feat/code-surface-phase2
Jul 23, 2026
Merged

feat(code): default-on Code surface, github→code tab alias (cave-m6ys)#3732
BunsDev merged 1 commit into
mainfrom
feat/code-surface-phase2

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 23, 2026

Copy link
Copy Markdown
Member

Phase 2 of the dedicated Code surface (cave-m6ys, follow-up to cave-k0ua / PRs #3716 #3719 #3722 #3724 #3727 #3730).

What changed

1. Flag retired, not defaulted. caveCodeSurface() is deleted from feature-flags.ts, along with every flag-off fallback it guarded: the setMode funnel gate, the cave:navigate-mode legacy redirect, and the sidebar's conditional row spread. There is no "off" world left to bit-rot.

2. GitHub absorbed as a tab alias. "github" moves from the canonical WorkspaceMode union into MODE_ALIASES (github → "code"), joining the kept-in-state tab-selector class (calendar, familiar-work-queue, roles, capabilities). Continuity table:

Entry point Before After
?mode=github deep link standalone GitHubView Code surface, GitHub tab active
persisted last-surface "github" standalone GitHubView Code surface, GitHub tab
openGitHubTarget(...) (badges, palette) GitHubView + initialTarget CodeView forwards githubTarget to the same GitHubView under its tab
sidebar row highlight for mode "github" GitHub row Code row (via shared MODE_ALIASES in sidebar-nav-state)
⌘1–5 SURFACE_ORDER no github/code unchanged

Render branch follows the calendar template exactly: mode === "code" || mode === "github" + key={mode} remount + initialTopTab={mode === "github" ? "github" : undefined}. githubTarget still wins the tab precedence, then deep-link ctab, then the alias prop.

3. Sidebar. Static quiet Code row (badge = githubAssignedCount); standalone GitHub row deleted with a doesNotMatch pin keeping it gone. loadGitHubView stays in lazy-surfaces — preloadSidebarSurface("github") warmup and Code's GitHub tab load the same chunk; only the unused GitHubView dynamic wrapper is removed.

4. Playwright. NEXT_PUBLIC_CAVE_CODE_SURFACE=1 removed from the webServer env — e2e now runs the same always-on world as production.

Deliberately deferred (follow-up bead)

Slimming Chat's code rail + retargeting cave:open-file / pendingCodeRailOpen at the Code surface. The existing pin in code-surface-mode.test.ts ("file-open events keep targeting Chat's code rail") still documents that boundary and stays green.

Verification

  • pnpm typecheck clean
  • Targeted pin suites green: code-surface-mode, workspace-alias-modes, sidebar-minimal, github-native-open, sidebar-nav-state, github-subscribe-ux, surface-warmup-registry, code-surface, chat-rail-modern-redesign
  • Full pnpm test:api + pnpm test:app green locally

Bead: cave-m6ys

Phase 2 of the Code surface (follow-up to cave-k0ua): the flag is retired
rather than defaulted — caveCodeSurface() is deleted and every flag-off
fallback with it — and the standalone GitHub surface is absorbed as Code's
GitHub tab. "github" moves from the canonical mode union to MODE_ALIASES
(kept-in-state tab-selector class, like calendar): deep links, persisted
last-surface, palette payloads, and openGitHubTarget() all keep working,
landing on Code with the GitHub tab active via key={mode} remount +
initialTopTab. The sidebar's conditional spread becomes a static Code row
carrying the assigned-work badge; GitHubView's lazy-surfaces wrapper is
deleted (loadGitHubView stays — warmup + Code's tab load the same chunk).

Deferred (follow-up bead): slimming Chat's code rail and retargeting
cave:open-file / pendingCodeRailOpen at the Code surface — the existing
rail pin in code-surface-mode.test.ts still documents that boundary.

Verified: typecheck; targeted pin suites; full test:api + test:app.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Retires the NEXT_PUBLIC_CAVE_CODE_SURFACE feature flag and makes the dedicated Code surface the only navigation world, while preserving continuity for existing GitHub entry points by turning "github" into an alias that mounts the Code surface with the GitHub tab active.

Changes:

  • Removed caveCodeSurface() and all flag-off fallbacks/redirects so the Code surface is always available.
  • Converted "github" from a canonical workspace mode into a MODE_ALIASES entry (github → code) and routed ?mode=github / persisted "github" state into CodeView’s GitHub tab.
  • Updated sidebar, tests, and Playwright config to reflect the default-on world (no env flag in e2e).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/code-surface.spec.ts Updates spec header to reflect default-on behavior (no env flag).
src/lib/workspace-mode.ts Removes "github" from canonical modes; adds it as an alias to "code" via MODE_ALIASES.
src/lib/sidebar-nav-state.test.ts Adds pin ensuring "github" alias highlights the Code row.
src/lib/feature-flags.ts Deletes caveCodeSurface() entirely (flag retirement).
src/components/workspace.tsx Removes flag gating + standalone GitHub surface; mounts CodeView for `mode === "code"
src/components/workspace-alias-modes.test.ts Pins the new "github" → "code" alias behavior and keyed remount pattern.
src/components/sidebar-minimal.tsx Replaces conditional Code/GitHub row swap with a static Code row; GitHub is now a tab.
src/components/sidebar-minimal.test.ts Updates sidebar pins to assert Code row visibility by default.
src/components/lazy-surfaces.tsx Removes the exported GitHubView dynamic wrapper; retains GitHub loader for warmup/preload use.
src/components/github-native-open.test.ts Updates pins to ensure GitHub deep-link targets flow through CodeView.
src/components/code-view.tsx Adds initialTopTab prop and uses it in top-tab selection precedence.
src/components/code-surface-mode.test.ts Updates pins to enforce “default-on” and removal of any flag-gated wiring/fallbacks; asserts sidebar no longer contains a GitHub row.
src/components/chat-rail-modern-redesign.test.ts Updates pin to ensure navigate-mode events always funnel through setMode (no code-redirect branch).
playwright.config.ts Removes NEXT_PUBLIC_CAVE_CODE_SURFACE=1 from webServer env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +91 to +94
// The standalone GitHubView dynamic wrapper is gone (cave-m6ys): GitHub
// mounts only as Code's GitHub tab (code-view.tsx owns that lazy import).
// loadGitHubView stays for preloadSidebarSurface — warming the chunk still
// pays off when the user opens the tab.
@BunsDev
BunsDev merged commit ae043ea into main Jul 23, 2026
16 checks passed
@BunsDev
BunsDev deleted the feat/code-surface-phase2 branch July 23, 2026 23:04
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