Skip to content

refactor(workstation): remove unreachable My Station code - #1841

Merged
FresnelR27 merged 1 commit into
developfrom
refactor/remove-dead-workstation-code
Sep 15, 2026
Merged

FresnelR27 merged 1 commit into
developfrom
refactor/remove-dead-workstation-code

Conversation

@Harry19081

Copy link
Copy Markdown
Member

Problem

An audit of My Station traced UI, state and helpers that no production path reaches. They keep dead contracts alive and mislead anyone reading the code:

  • The tab-bar bottom-panel toggle renders nothing at all five mounts, because its onToggleBottomPanel callback has had no writer since the panels were archived. Its DevTools twin is never mounted. FileHeader.beforeMoreMenuSlot existed only to host the toggle.
  • TabBar.onMoreOptions is never passed, so the more-options button never renders.
  • src/config/workstation/tokens.ts exports HEADER_HEIGHT = 40, documented as the height of every Workstation header although it has no importers and every bar is 36px, plus several other unreferenced tokens and keys.
  • PrimarySidebarLayoutWithSections carries a tab dropdown that cannot open and three props with no callers; PanelSectionHeader has no consumers.
  • CodeEditor mounts a FileSearchPanel overlay that nothing can open. The indexing-progress atoms have no writers, so the status-bar indexing indicator can never appear. IDE_APP_CONFIG and updateCachedFileMtime have no production callers.

Solution

Delete the unreachable code and everything that existed only to feed it. Each item was traced to zero live callers, importers or passers before removal.

  • Tab bar and file header: TabBarTrailingControls.tsx and its test, the five mounts and barrel export, FileHeader.beforeMoreMenuSlot, StatusBarCallbacks.onToggleBottomPanel and bottomPanelCollapsed, and the more-options button with its onMoreOptions prop.
  • Tokens: HEADER_HEIGHT, TAB_BAR_CONTROLS_ROW_BASE_CLASS, TAB_BAR_CONTROLS_ROW_PADDING_TRAILING_ONLY, TAB_BAR_CONTROLS_ROW_CLASS, SECTION_ACTION_BUTTON, ROW_BUTTON, nine unused HEADER_BUTTON keys, SEARCH_TAB_ROW_CLASSES.withBorder and five unused PANEL_CONSTANTS fields. Two inset constants are un-exported and stale "Used by" docs are removed. The class strings for the two remaining HEADER_BUTTON keys are unchanged.
  • Sidebar sections: PanelSectionHeader, the never-openable tab dropdown, the globalSection, headerSlot and widthClass props, CollapsibleSection.showTopBorder (only the removed global section passed it) and a title special case for an action key that does not exist.
  • CodeEditor: the FileSearchPanel overlay with its visibility state, four handlers and the onSearchClick sidebar prop; the indexing-progress atoms, useIndexingIndicator and the status-bar indicator; IDE_APP_CONFIG; updateCachedFileMtime and its tests.
  • i18n: the ten message keys referenced only by the removed code, deleted from all 13 locales so check:i18n-keys reports no new unused keys.

No runtime behavior is intended to change. This PR is independent of #1838 and can merge in either order.

Potential risks

  • File headers at the five former toggle mounts no longer render an empty right-side container when they have no other right-side controls, which can remove one flex gap in those headers. This was not checked in the running app.
  • The removed props, fields, tokens and exports are internal. Nothing in the repository uses them, but an in-flight branch that does will fail to compile after rebasing, and one that references a removed message key will show it as missing in check:i18n-keys.
  • Dead code deliberately left for separate changes: the bottom-panel atoms, panel.toggleBottom action and Spotlight entry (removing them removes a visible no-op command), the project tab-bar search chain, the shortcut bridge with its unreachable Save / Don't Save dialog (to be decided with the ⌘W close-guard fix), unreachable Browser tab code, constant replay placeholder helpers and the WorkStation/Canvas module.
  • Rollback is a plain revert.

Verification

  • node_modules/.bin/prettier --check, node_modules/.bin/oxlint -c .oxlintrc.json --max-warnings 0 and node_modules/.bin/eslint --max-warnings 0 --report-unused-disable-directives on the 30 changed TypeScript files: all pass.
  • node_modules/.bin/tsgo --noEmit --pretty false: exit 0.
  • node_modules/.bin/vitest run --config config/vitest.config.ts over src/modules/WorkStation, src/store/workstation, src/store/ui/workStationLayout, src/modules/shared/components/FileHeader, src/modules/shared/layouts and the six dependent suites outside them (CanvasApp.test.ts, CanvasApp.share.test.ts, SubagentPipCard.lifecycle.test.ts, ProjectManagerContentRouter.test.ts, SidebarSettingsMenuButton.test.ts, scrollbarStyleContract.test.ts): 248 files, 1,554 tests passed.
  • node scripts/quality/i18n-keys/check.mjs: missing 0; unused 0 new (13 current, 19 baselined).
  • node scripts/quality/check-test-placement.mjs: consistent. git diff --check: clean.
  • Committed from a linked worktree with hooks enabled (lint-staged, tsgo gated to staged files). The worktree's .git is a file, so the "Pre-commit hook ran." trailer is not appended.
  • Not run: the full unit suite, check:typed-lint, and the app itself. No screenshots, because the removed code never rendered anything visible; the one possible layout effect is listed under Potential risks.

Delete code with no live caller, each traced before removal:

- Tab bar: the bottom-panel and DevTools toggles (the first rendered
  nothing at its five mounts, the second was never mounted),
  FileHeader.beforeMoreMenuSlot, two StatusBarCallbacks fields and the
  never-passed more-options button.
- Workstation tokens: HEADER_HEIGHT, three tab-bar row classes,
  SECTION_ACTION_BUTTON, ROW_BUTTON, unused HEADER_BUTTON keys and
  PANEL_CONSTANTS fields.
- Sidebar sections: PanelSectionHeader, the tab dropdown that could
  never open, globalSection, headerSlot, widthClass and showTopBorder.
- CodeEditor: the FileSearchPanel overlay with its state and handlers,
  the indexing-progress pipeline and status-bar indicator,
  IDE_APP_CONFIG and updateCachedFileMtime.
- i18n: the ten message keys only those removals referenced.
@FresnelR27
FresnelR27 merged commit 36a9e20 into develop Sep 15, 2026
14 checks passed
@Harry19081 Harry19081 added refactor Code restructuring without an intended behavior change workstation Workstation, editor, source control, LSP, or status bar labels Sep 16, 2026
hbrls pushed a commit to nice-fungal/ORG2 that referenced this pull request Sep 29, 2026
Add the architecture audit of My Station (behaviour defects, findings
by area, suggested PR waves) and the companion UI audit of its 36px
bars and sidebars (21 fix, 8 abstract, 12 keep with reason, 1 watch).

Both reports note what the follow-up PRs apply: org2AI#1838 (inset motion
only on station toggle, no chat header rule) and org2AI#1841 (unreachable
code removal).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without an intended behavior change workstation Workstation, editor, source control, LSP, or status bar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants