Remove ten orphaned Message variants from bds-ui #44

Closed
opened 2026-07-20 10:38:18 +00:00 by hugo · 1 comment
Owner

Context

Ten variants of Message in crates/bds-ui/src/app.rs have match arms in update() but are never constructed anywhere in the workspace (verified: no Message::X, Self::X, or aliased construction sites): ClearTabs, PinTab, PostLoaded, MediaLoaded, ScriptLoaded, TemplateLoaded, ShowToast, ProjectCreated, ProjectDeleted, ProjectSwitched. They are dead plumbing left from earlier load/CRUD flows that were since replaced by the direct handler paths (project switching now goes through the engine handlers, entity loads happen synchronously on tab open).

AGENTS rule: don't leave unused code in the codebase.

Task

  1. For each of the ten variants, first confirm it is still unconstructed (grep -rn "Message::<Name>\|Self::<Name>" crates/), then delete the enum variant and its match arm plus any helper functions or types only reachable from that arm.
  2. If deleting a handler orphans further private functions (e.g. a load-result application helper used only by PostLoaded), delete those too, recursively.
  3. Do not change behavior: no handler that is actually reachable may be touched.
  4. Build and run cargo test --workspace; fix any test that constructed these variants directly by removing/adjusting the test (a test constructing a dead variant is testing dead code).

Definition of done

  • The ten variants are gone, the workspace compiles with no new warnings, and cargo test --workspace passes.
## Context Ten variants of `Message` in `crates/bds-ui/src/app.rs` have match arms in `update()` but are never constructed anywhere in the workspace (verified: no `Message::X`, `Self::X`, or aliased construction sites): `ClearTabs`, `PinTab`, `PostLoaded`, `MediaLoaded`, `ScriptLoaded`, `TemplateLoaded`, `ShowToast`, `ProjectCreated`, `ProjectDeleted`, `ProjectSwitched`. They are dead plumbing left from earlier load/CRUD flows that were since replaced by the direct handler paths (project switching now goes through the engine handlers, entity loads happen synchronously on tab open). AGENTS rule: don't leave unused code in the codebase. ## Task 1. For each of the ten variants, first confirm it is still unconstructed (`grep -rn "Message::<Name>\|Self::<Name>" crates/`), then delete the enum variant and its match arm plus any helper functions or types only reachable from that arm. 2. If deleting a handler orphans further private functions (e.g. a load-result application helper used only by `PostLoaded`), delete those too, recursively. 3. Do not change behavior: no handler that is actually reachable may be touched. 4. Build and run `cargo test --workspace`; fix any test that constructed these variants directly by removing/adjusting the test (a test constructing a dead variant is testing dead code). ## Definition of done - The ten variants are gone, the workspace compiles with no new warnings, and `cargo test --workspace` passes.
hugo added the bug label 2026-07-20 10:40:07 +00:00
Author
Owner

Implemented in b10212d. Removed the ten unconstructed Message variants and their unreachable update arms: ClearTabs, PinTab, PostLoaded, MediaLoaded, ScriptLoaded, TemplateLoaded, ShowToast, ProjectCreated, ProjectDeleted, and ProjectSwitched. A recursive reachability review confirmed that tab pinning, project lifecycle operations, editor loading, and toast behavior remain reachable through their live direct paths, so no behavior or Allium/bDS2 semantics changed. Verification passed: exact-symbol search, rustfmt check, cargo check/test for bds-ui, strict workspace clippy, workspace build/test, Allium check/analyse, cargo machete, and cargo outdated.

Implemented in b10212d. Removed the ten unconstructed Message variants and their unreachable update arms: ClearTabs, PinTab, PostLoaded, MediaLoaded, ScriptLoaded, TemplateLoaded, ShowToast, ProjectCreated, ProjectDeleted, and ProjectSwitched. A recursive reachability review confirmed that tab pinning, project lifecycle operations, editor loading, and toast behavior remain reachable through their live direct paths, so no behavior or Allium/bDS2 semantics changed. Verification passed: exact-symbol search, rustfmt check, cargo check/test for bds-ui, strict workspace clippy, workspace build/test, Allium check/analyse, cargo machete, and cargo outdated.
hugo closed this issue 2026-07-20 13:33:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hugo/RuDS#44