Repository navigation
Description
Spun off from the architectural-audit tracking issue #1228 (finding C6 — frontend migration residue). Verified against
main2026-05-30; the audit's line numbers were stale and are corrected below.
Background
Frontend migration residue from completed migrations (#557 cache removal, #690 schema-defaults simplification, the FocusManager action-based rewrite) still litters the service layer as (a) tombstone comments describing code that no longer exists and (b) a full @deprecated "legacy compatibility" API layer in FocusManager. The latter violates the repo's no backward-compat / no @deprecated / delete-don't-deprecate rule (CLAUDE.md).
This is two cleanly separable jobs. Do both in one PR.
Job A — Delete tombstone comments
Pure-noise comments describing removed code. Verified locations in packages/desktop-app/src/lib/services/reactive-node-service.svelte.ts:
:35-36— "Schema defaults extraction removed in Issue Simplify Schema Architecture: Remove SchemaDefinition and SchemaService #690 simplification" (theTODO: Re-add schema defaultson :36 is a real open TODO — KEEP it, or fold into Simplify Schema Architecture: Remove SchemaDefinition and SchemaService #690 follow-up; do not delete):230-232— "DEPRECATED: clearAllAutoFocus() removed / Focus is now managed by FocusManager...":317— "(autoFocus removed - now derived from FocusManager)":560— "Schema defaults extraction was removed in Issue Simplify Schema Architecture: Remove SchemaDefinition and SchemaService #690 simplification"
⚠️ DO NOT delete the "NOTE: X removed (Issue #557) — backend handles ordering via fractional ordering" comments (e.g.:386, :484, :702, :900-901, :1417, :1420, :1762, and similar). These are load-bearing: they document an intentional absence of sibling-chain/cache management in the frontend. A future dev who deletes them and sees no cache logic could "helpfully" re-add it and reintroduce the #557 bug class. Keep these. Job A removes only tombstones for code whose absence needs no explanation (schema defaults, clearAllAutoFocus, autoFocus).Also KEEP real open TODOs tied to live issues:
:448 TODO(#656): Emit error eventand:36.
Job B — Delete the FocusManager legacy/@deprecated API layer
packages/desktop-app/src/lib/services/focus-manager.svelte.ts (389 lines) carries an explicit "LEGACY API - Backwards Compatibility (will be removed after migration)" section plus parallel "keep legacy state in sync during migration" plumbing:
- Legacy state declarations + sync:
:60,:83,:125,:138,:153,:171,:240 @deprecatedgetters:pendingCursorPosition,arrowNavigationContext,arrowNavDirection,arrowNavPixelOffset,nodeTypeConversionCursorPosition(:191-226)@deprecatedmethods:setEditingNodeFromArrowNavigation,setEditingNodeFromInheritedType,focusNodeFromTypeConversion,clearArrowNavigationContext,getCurrentState(:249, :273, :297, :350, :366)
Production-dead, test-only alive (verified via grep + LSP). No production code outside focus-manager.svelte.ts calls these legacy getters/methods — the only non-test reference (textarea-controller.svelte.ts:441-443 this.pendingCursorPosition) is a field on a different class, unrelated. Every other caller lives in:
packages/desktop-app/src/tests/services/focus-manager.test.tspackages/desktop-app/src/tests/services/focus-manager-cursor-positioning.test.ts
Action: delete the legacy state + the @deprecated getters/methods + the migration-sync plumbing. Then migrate the two test files: rewrite assertions to use the current API (cursorPosition, focusNode/focusNodeAtPosition/focusNodeAtLine, focusNodeFromArrowNav, setEditingNode/clearEditing — the replacements named in each @deprecated doc comment) instead of the legacy surface. Where a test exists only to exercise a legacy method (e.g. a "legacy arrow nav" test), delete it if the current-API path is already covered elsewhere; otherwise port it to the current API. Do not keep a legacy test asserting legacy behavior.
Acceptance criteria
- Job A: the four tombstone comment sites above are removed; the Delete obsolete cache management code from SharedNodeStore #557 "intentional absence" comments and the real
TODO(#656)/:36TODOs are preserved. - Job B: no
@deprecatedannotations remain infocus-manager.svelte.ts; the "LEGACY API" section and all "legacy state ... during migration" plumbing are deleted. - Job B:
focus-manager.test.tsandfocus-manager-cursor-positioning.test.tsreference only the current FocusManager API; no test asserts legacy-API behavior. -
grep -rn "@deprecated" packages/desktop-app/src/lib/services/focus-manager.svelte.tsreturns nothing. - No new lint suppressions; no
{@html}; logging viacreateLogger(no raw console). Delete, don't comment-out.
Testing
-
bun run testgreen — specifically the two focus-manager test files pass against the current API after migration (no new failures vs baseline). -
bun run check(svelte-check) clean — removing the legacy getters must not leave dangling type references. - Manually sanity-check focus behavior is unaffected: this is dead-code removal, so runtime behavior should be identical. If any production path did secretly depend on the legacy sync,
bun run check+ tests will surface it.
Out of scope
- C1/C2/C3 hierarchy/layer rework — separate issues. This is residue deletion only; do not restructure
reactive-node-service.svelte.tsor the store layer here. - The
backend-adapter.ts:113site named in the original audit is no longer residue — that line is now the currentmoveNode(... InsertPosition ...)signature from API: introduce InsertPosition enum across proto/gRPC + service (replace overloaded insert_after_node_id) #1236. Nothing to do there.
Standard NodeSpace startup / PR sequence
Primary checkout git status + git pull origin main, then EnterWorktree({name: "issue-<N>-frontend-residue-cleanup"}); inside: bun install, baseline bun run test, bun run gh:assign <N> "@me", bun run gh:status <N> "In Progress". Use createLogger not console.*; bun run test not bun test. Before PR: bun run test:all + bun run check (no new failures), bun run quality:fix, commit, bun run gh:pr <N>. /pragmatic-code-review before merge, then ExitWorktree({action: "remove", discard_changes: true}) and gh pr merge <PR#> --squash --delete-branch.
Spun off from #1228 (architectural audit), finding C6.
Activity
malibio commentedon May 30, 2026
Frontend baseline: 131 files, 3924 tests passed
Delete frontend migration residue: tombstone comments + FocusManager …