Skip to content

refactor(notebook): remove more dead code from NotebookState and lib.rs#559

Merged
rgbkrk merged 1 commit intomainfrom
540/notebook-state-continued-cleanup
Mar 6, 2026
Merged

refactor(notebook): remove more dead code from NotebookState and lib.rs#559
rgbkrk merged 1 commit intomainfrom
540/notebook-state-continued-cleanup

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 6, 2026

Continued cleanup for #556.

notebook_state.rs (−170 lines)

Removed Reason
new_empty() All production callers use new_empty_with_runtime — this was the unparameterized convenience method
get_code_cell_ids Zero production callers
serialize() Zero production callers — daemon handles save via Automerge
cell_to_frontend visibility pub → private — only called by cells_for_frontend in the same file

lib.rs (−73 lines)

Removed Reason
debug_get_automerge_state Zero frontend callers. Reads the relay's middle-copy Automerge doc — no longer the interesting view since the frontend has its own WASM doc and the daemon has the canonical doc.
debug_get_local_state Same — redundant with the WASM doc.

5 tests rewritten to use new_empty_with_runtime(Runtime::Python). 7 tests for deleted methods removed. 11 notebook_state tests + 140 total still passing.

−243 lines.

Continued cleanup for #556.

notebook_state.rs:
- Remove new_empty() — all production callers use new_empty_with_runtime
- Remove get_code_cell_ids — zero production callers
- Remove serialize() — zero production callers (daemon handles save)
- Make cell_to_frontend private — only called by cells_for_frontend

lib.rs:
- Remove debug_get_automerge_state — zero frontend callers, reads the
  relay's middle-copy doc which is no longer the interesting view
- Remove debug_get_local_state — same, redundant with WASM doc

Rewrites 5 tests from new_empty() to new_empty_with_runtime(Runtime::Python).
Removes 7 tests for deleted methods. 11 notebook_state tests still passing.

-243 lines.
@rgbkrk rgbkrk enabled auto-merge (squash) March 6, 2026 08:51
@rgbkrk rgbkrk merged commit afe3ac2 into main Mar 6, 2026
10 checks passed
@rgbkrk rgbkrk deleted the 540/notebook-state-continued-cleanup branch March 6, 2026 09:06
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