Skip to content

refactor(notebook): remove dead NotebookState cell mutation methods#558

Merged
rgbkrk merged 1 commit intomainfrom
540/remove-dead-notebook-state
Mar 6, 2026
Merged

refactor(notebook): remove dead NotebookState cell mutation methods#558
rgbkrk merged 1 commit intomainfrom
540/remove-dead-notebook-state

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 6, 2026

Continued cleanup after the Automerge migration (#553, #554).

Removes 8 NotebookState methods that have zero production callers — all cell mutations now go through the WASM NotebookHandle + Automerge sync:

Removed method Was used by
find_cell_index All other removed methods (transitively dead)
update_cell_source Dead update_cell_source Tauri command (removed in #554)
get_cell_source Only tests
add_cell Dead add_cell Tauri command (removed in #554)
delete_cell Dead delete_cell Tauri command (removed in #554)
clear_cell_outputs Only tests
set_cell_execution_count Only tests
append_cell_output Only tests

Also removes source_to_lines helper and unused Output import.

3 tests that called removed methods were rewritten to construct nbformat cells directly. 16 notebook_state tests still passing.

−420 lines.

Remove 8 methods from NotebookState that have zero production callers
since cell mutations moved to the WASM Automerge doc:

- find_cell_index
- update_cell_source
- get_cell_source
- add_cell
- delete_cell
- clear_cell_outputs
- set_cell_execution_count
- append_cell_output

Also removes source_to_lines helper (only used by update_cell_source)
and the unused Output import. Rewrites 3 remaining tests to construct
nbformat cells directly instead of using the removed methods.

-420 lines, 16 tests still passing.
@rgbkrk rgbkrk enabled auto-merge (squash) March 6, 2026 08:34
@rgbkrk rgbkrk merged commit b1ee736 into main Mar 6, 2026
10 checks passed
@rgbkrk rgbkrk deleted the 540/remove-dead-notebook-state branch March 6, 2026 08:38
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.

1 participant