feat(code): default-on Code surface, github→code tab alias (cave-m6ys)#3732
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 aMODE_ALIASESentry (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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromfeature-flags.ts, along with every flag-off fallback it guarded: thesetModefunnel gate, thecave:navigate-modelegacy 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 canonicalWorkspaceModeunion intoMODE_ALIASES(github → "code"), joining the kept-in-state tab-selector class (calendar, familiar-work-queue, roles, capabilities). Continuity table:?mode=githubdeep link"github"openGitHubTarget(...)(badges, palette)githubTargetto the same GitHubView under its tab"github"MODE_ALIASESin sidebar-nav-state)⌘1–5SURFACE_ORDERRender branch follows the calendar template exactly:
mode === "code" || mode === "github"+key={mode}remount +initialTopTab={mode === "github" ? "github" : undefined}.githubTargetstill wins the tab precedence, then deep-linkctab, then the alias prop.3. Sidebar. Static quiet Code row (badge =
githubAssignedCount); standalone GitHub row deleted with adoesNotMatchpin keeping it gone.loadGitHubViewstays in lazy-surfaces —preloadSidebarSurface("github")warmup and Code's GitHub tab load the same chunk; only the unusedGitHubViewdynamic wrapper is removed.4. Playwright.
NEXT_PUBLIC_CAVE_CODE_SURFACE=1removed 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/pendingCodeRailOpenat the Code surface. The existing pin incode-surface-mode.test.ts("file-open events keep targeting Chat's code rail") still documents that boundary and stays green.Verification
pnpm typecheckcleanpnpm test:api+pnpm test:appgreen locallyBead: cave-m6ys