Repository navigation
Delete frontend migration residue: tombstone comments + FocusManager legacy/@deprecated API (C6) - #1249
Conversation
…legacy API (closes #1246) Job A: Remove tombstone comments in reactive-node-service.svelte.ts that described removed code (schema defaults extraction, clearAllAutoFocus). Preserve the load-bearing #557 intentional-absence comments and the real TODO(#656) and :36 TODOs. Job B: Delete FocusManager's entire legacy/deprecated API layer — the five @deprecated getters (_pendingCursorPosition, _arrowNavDirection, _arrowNavPixelOffset, _nodeTypeConversionCursorPosition, arrowNavigationContext) and the deprecated methods (setEditingNode, setEditingNodeFromArrowNavigation, setEditingNodeFromTypeConversion, clearArrowNavigationContext, clearNodeTypeConversionCursorPosition), along with their backing state variables. Rename setEditingNodeFromInheritedType → focusNodeFromInheritedType to match the current-API naming convention. Migrate all production callers in base-node-viewer.svelte, base-node.svelte, node-service-context.svelte, and reactive-node-service.svelte.ts to the current API. Rewrite focus-manager.test.ts and focus-manager-cursor-positioning.test.ts to use only the current API; update shared-node-store-skip-while-editing.test.ts similarly. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
malibio
left a comment
There was a problem hiding this comment.
Code Review Summary
This is a clean, well-executed residue deletion PR. Both Job A (tombstone comments) and Job B (legacy FocusManager API) are complete with no production regressions. All 3,911 tests pass. svelte-check reports 0 errors and 0 warnings across 1,643 files.
The change is definitively net positive: it removes ~190 lines of dead legacy-compatibility code, eliminates all @deprecated annotations from focus-manager.svelte.ts, and leaves the service layer in a clean, single-API state.
Findings
Suggested Improvements
/packages/desktop-app/src/lib/services/focus-manager.svelte.ts line 200 — getFocusManager() is still present and retains a test suite
The function still exists:
export function getFocusManager() {
return focusManager;
}The only production consumer is reactive-node-service.svelte.ts (lines 25, 109), where it is used to obtain a local alias (const focusManager = getFocusManager()). Every other call site in the codebase imports focusManager directly. The issue explicitly removed the // Legacy export for backwards compatibility comment that labelled this function, but the function itself was kept, and focus-manager.test.ts still has a describe('getFocusManager (legacy export)') block (lines 155–168) that calls it.
The wrapper adds no value — it simply returns the module-singleton — and its label in the test suite ("legacy export") flags it as intended for deletion. CLAUDE.md policy: delete, do not deprecate. Recommend:
- Change
reactive-node-service.svelte.tsline 25 toimport { focusManager } from './focus-manager.svelte'and remove the local alias at line 109. - Delete
getFocusManager()fromfocus-manager.svelte.ts. - Delete the
describe('getFocusManager (legacy export)')block from the test file.
This is not a blocker — the function is benign — but it is the one piece of the legacy surface the PR missed.
/packages/desktop-app/src/lib/services/focus-manager.svelte.ts line 52 — ArrowNavigationContext interface is now an orphaned export
export interface ArrowNavigationContext {
direction: 'up' | 'down';
pixelOffset: number;
}With the removal of the arrowNavigationContext getter and FocusState.arrowNavigationContext, nothing imports this interface. Confirmed via grep — only focus-manager.svelte.ts defines it, no other file imports it. It should be deleted alongside the getter cleanup. Not a blocker, but is dead code.
Nitpicks
-
Nit:
reactive-node-service.svelte.tslines 35–36: The tombstone "Schema defaults extraction removed in Issue #690 simplification" comment on line 35 was preserved. The issue's deletion list was:35-36with an explicit note to KEEP theTODOon line 36. Line 35 is the tombstone; line 36 is the valid TODO. Both lines survived. The TODO context is arguably helpful, so this is a judgment call — just worth confirming the intent matches the spec. -
Nit:
getCurrentState()returns aFocusStateobject that now has no consumer outside debug/test use. Fine to keep for diagnostics, butFocusStateis now a thin struct that could be inlined if desired.
Acceptance Criteria Verification
- Job A: tombstone comment sites in
reactive-node-service.svelte.tsremoved (:230-232,:317,:560). Lines:35-36retained (see Nit above). - The
#557"intentional absence" NOTE comments are all preserved. -
TODO(#656)on line 443 and the:36TODO are preserved. - Job B: no
@deprecatedannotations remain; the "LEGACY API" section and all migration-sync plumbing are deleted. - Both focus-manager test files reference only the current API; all legacy-API test blocks removed.
-
grep -rn "@deprecated" packages/desktop-app/src/lib/services/focus-manager.svelte.ts— returns nothing. - No new lint suppressions; no
{@html}; no new rawconsole.*calls introduced. -
bun run test— 3,911 tests passed, 0 failures. -
bunx svelte-check— 0 errors, 0 warnings, 1,643 files checked.
Assessment: LGTM with two small follow-on cleanup items (getFocusManager wrapper + ArrowNavigationContext orphaned export). Neither is a blocker. Safe to merge.
Code Review SummaryThis is a clean, well-executed residue deletion PR. Both Job A (tombstone comments) and Job B (legacy FocusManager API) are complete with no production regressions. All 3,911 tests pass. The change is definitively net positive: it removes ~190 lines of dead legacy-compatibility code, eliminates all FindingsSuggested Improvements
The function still exists and The wrapper adds no value — it is a pass-through to the module singleton. CLAUDE.md policy is delete, not deprecate. Recommend a follow-on:
Not a blocker — the function is benign — but it is the one piece of legacy surface the PR missed.
export interface ArrowNavigationContext {
direction: 'up' | 'down';
pixelOffset: number;
}With the Nitpicks
Acceptance Criteria Verification
LGTM. Two small follow-on cleanup items ( |
- Delete orphaned ArrowNavigationContext export (no external consumers after legacy API removal) - Delete getFocusManager() wrapper; reactive-node-service.svelte.ts now imports focusManager directly - Remove legacy getFocusManager test describe block from focus-manager.test.ts - Remove unused getFocusManager import from reactive-node-service.test.ts Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Addressed review feedback: deleted orphaned |
…legacy/@deprecated API (C6) (#1249) * Delete frontend migration residue: tombstone comments + FocusManager legacy API (closes #1246) Job A: Remove tombstone comments in reactive-node-service.svelte.ts that described removed code (schema defaults extraction, clearAllAutoFocus). Preserve the load-bearing #557 intentional-absence comments and the real TODO(#656) and :36 TODOs. Job B: Delete FocusManager's entire legacy/deprecated API layer — the five @deprecated getters (_pendingCursorPosition, _arrowNavDirection, _arrowNavPixelOffset, _nodeTypeConversionCursorPosition, arrowNavigationContext) and the deprecated methods (setEditingNode, setEditingNodeFromArrowNavigation, setEditingNodeFromTypeConversion, clearArrowNavigationContext, clearNodeTypeConversionCursorPosition), along with their backing state variables. Rename setEditingNodeFromInheritedType → focusNodeFromInheritedType to match the current-API naming convention. Migrate all production callers in base-node-viewer.svelte, base-node.svelte, node-service-context.svelte, and reactive-node-service.svelte.ts to the current API. Rewrite focus-manager.test.ts and focus-manager-cursor-positioning.test.ts to use only the current API; update shared-node-store-skip-while-editing.test.ts similarly. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Address review: delete ArrowNavigationContext + getFocusManager wrapper - Delete orphaned ArrowNavigationContext export (no external consumers after legacy API removal) - Delete getFocusManager() wrapper; reactive-node-service.svelte.ts now imports focusManager directly - Remove legacy getFocusManager test describe block from focus-manager.test.ts - Remove unused getFocusManager import from reactive-node-service.test.ts Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #1246