Skip to content

Delete frontend migration residue: tombstone comments + FocusManager legacy/@deprecated API (C6) - #1249

Merged
malibio merged 2 commits into
mainfrom
worktree-issue-1246-frontend-residue-cleanup
May 30, 2026
Merged

malibio merged 2 commits into
mainfrom
worktree-issue-1246-frontend-residue-cleanup

Conversation

@malibio

@malibio malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Closes #1246

…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 malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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:

  1. Change reactive-node-service.svelte.ts line 25 to import { focusManager } from './focus-manager.svelte' and remove the local alias at line 109.
  2. Delete getFocusManager() from focus-manager.svelte.ts.
  3. 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.ts lines 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-36 with an explicit note to KEEP the TODO on 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 a FocusState object that now has no consumer outside debug/test use. Fine to keep for diagnostics, but FocusState is now a thin struct that could be inlined if desired.


Acceptance Criteria Verification

  • Job A: tombstone comment sites in reactive-node-service.svelte.ts removed (:230-232, :317, :560). Lines :35-36 retained (see Nit above).
  • The #557 "intentional absence" NOTE comments are all preserved.
  • TODO(#656) on line 443 and the :36 TODO are preserved.
  • Job B: no @deprecated annotations 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 raw console.* 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.

@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

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

focus-manager.svelte.ts line 200 — getFocusManager() wrapper survived the cleanup

The function still exists and reactive-node-service.svelte.ts is its only production consumer (lines 25, 109), using it only to create a local alias. Every other call site imports focusManager directly. The PR correctly removed the // Legacy export for backwards compatibility label but left the body. The test file retains a describe('getFocusManager (legacy export)') block (lines 155–168) that explicitly flags this as legacy.

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:

  1. Change reactive-node-service.svelte.ts import to import { focusManager } from './focus-manager.svelte' and remove the local alias.
  2. Delete getFocusManager() from focus-manager.svelte.ts.
  3. Delete the describe('getFocusManager (legacy export)') block from focus-manager.test.ts.

Not a blocker — the function is benign — but it is the one piece of legacy surface the PR missed.

focus-manager.svelte.ts line 52 — ArrowNavigationContext is now an orphaned export

export interface ArrowNavigationContext {
  direction: 'up' | 'down';
  pixelOffset: number;
}

With the arrowNavigationContext getter and FocusState.arrowNavigationContext removed, nothing imports this interface (confirmed via grep). Should be deleted in the same follow-on pass as getFocusManager.


Nitpicks

  • Nit: reactive-node-service.svelte.ts lines 35–36 — the deletion target was :35-36 with an explicit note to KEEP line 36's TODO. Line 35 (tombstone) survived alongside the TODO. The context is arguably helpful so leaving it is defensible, but worth confirming intent matches the spec.

  • Nit: FocusState is now a two-field struct with no external consumers. Fine to keep for getCurrentState() diagnostics; just noting it is now very thin.


Acceptance Criteria Verification

  • Job A: tombstone sites :230-232, :317, :560 in reactive-node-service.svelte.ts removed.
  • All #557 "intentional absence" NOTE comments preserved.
  • TODO(#656) and :36 TODO preserved.
  • Job B: zero @deprecated annotations remain in focus-manager.svelte.ts; "LEGACY API" section and all migration-sync plumbing 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 — empty.
  • No new lint suppressions; no {@html}; no new raw console.* calls.
  • bun run test — 3,911 passed, 0 failures.
  • bunx svelte-check — 0 errors, 0 warnings, 1,643 files checked.

LGTM. Two small follow-on cleanup items (getFocusManager wrapper + ArrowNavigationContext orphaned export) but neither is a blocker. Safe to merge.

- 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]>
@malibio

malibio commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed review feedback: deleted orphaned ArrowNavigationContext export, deleted getFocusManager() wrapper (reactive-node-service now imports focusManager directly), removed legacy test describe block. All 131 test files pass (3909 tests), svelte-check clean.

@malibio
malibio merged commit 67b1311 into main May 30, 2026
@malibio
malibio deleted the worktree-issue-1246-frontend-residue-cleanup branch May 30, 2026 09:44
malibio added a commit that referenced this pull request Jun 22, 2026
…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]>
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.

Delete frontend migration residue: tombstone comments + FocusManager legacy/@deprecated API (C6)

1 participant