Repository navigation
fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper (#136) - #137
KooshaPari wants to merge 1 commit into
Conversation
…per (#136) PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice") removed the only call site of `StartupHints::with_spawn_notice`, leaving the helper as a dead-code associated function. The session doc `docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md` (~line 113) records this leftover as an explicit follow-up. The CI "Quality Guardrails" check now fails with: error: associated function `with_spawn_notice` is never used --> crates/jcode-setup-hints/src/lib.rs:201:8 Delete the `with_spawn_notice` associated function entirely. No `#[allow(dead_code)]` — the call path is gone, the function should go too. Aggressive-change policy: remove, do not silence. Preserved: - `StartupHints::with_status_and_display` (used in 7+ call sites) - `SetupHintsState::startup_spawn_hint_dismissed` (state-file serde compat) - `fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>` (callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature) - `StartupHints::status_notice` field — read by `src/cli/tui_launch.rs:244` and `crates/jcode-setup-hints/src/setup_hints_tests.rs:272`, NOT dead. Validation: - cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0 - cargo fmt -p jcode-setup-hints -- --check: exit 0 - cargo test -p jcode-setup-hints --lib: same pre-existing platform-specific failures as master; no new failures introduced. The one setup_hints_test failure (`first_three_launches_can_include_hotkey_notice_too`) was already broken by PR #128 and is out of scope here. Closes #136 tx-agent: jcode tx-validated: test tx-task: #136 tx-scope: jcode-setup-hints tx-intent: remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
CodeAnt PR Risk: Low Risk
Assessed commit: |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Reviewed by free · Input: 47.5K · Output: 1.2K · Cached: 126.5K |
Superseded by #140 — do not merge#140 ( Action requested from the operator: close this PR (#137) without merging. No content is lost — everything it contains is already in #140. |
…ce_too to assert retired spawn-notice behavior (#139) (#140) * fix(setup-hints): delete orphaned StartupHints::with_spawn_notice helper (#136) PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice") removed the only call site of `StartupHints::with_spawn_notice`, leaving the helper as a dead-code associated function. The session doc `docs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md` (~line 113) records this leftover as an explicit follow-up. The CI "Quality Guardrails" check now fails with: error: associated function `with_spawn_notice` is never used --> crates/jcode-setup-hints/src/lib.rs:201:8 Delete the `with_spawn_notice` associated function entirely. No `#[allow(dead_code)]` — the call path is gone, the function should go too. Aggressive-change policy: remove, do not silence. Preserved: - `StartupHints::with_status_and_display` (used in 7+ call sites) - `SetupHintsState::startup_spawn_hint_dismissed` (state-file serde compat) - `fn startup_hints_for_launch(_state: &SetupHintsState) -> Option<StartupHints>` (callers at lib.rs:1353 + setup_hints_tests.rs depend on the signature) - `StartupHints::status_notice` field — read by `src/cli/tui_launch.rs:244` and `crates/jcode-setup-hints/src/setup_hints_tests.rs:272`, NOT dead. Validation: - cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0 - cargo fmt -p jcode-setup-hints -- --check: exit 0 - cargo test -p jcode-setup-hints --lib: same pre-existing platform-specific failures as master; no new failures introduced. The one setup_hints_test failure (`first_three_launches_can_include_hotkey_notice_too`) was already broken by PR #128 and is out of scope here. Closes #136 tx-agent: jcode tx-validated: test tx-task: #136 tx-scope: jcode-setup-hints tx-intent: remove orphaned with_spawn_notice to clear CI Quality Guardrails dead-code error * fix(setup-hints): update first_three_launches_can_include_hotkey_notice_too to assert retired spawn-notice behavior (#138) PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice", commit 081c1cf) retired the macOS launch-hotkey spawn notice. The function `startup_hints_for_launch` now always returns `None`, with a comment explaining the prior gate (`if !hotkey_configured || dismissed`) was unreachable because the crate never wrote `startup_spawn_hint_dismissed = false` (the field defaults to `true` in `SetupHintsState::default()`). The test `first_three_launches_can_include_hotkey_notice_too` was always broken — even before PR #128, its `hotkey_configured: true` state with `..SetupHintsState::default()` produced `dismissed = true`, which would short-circuit the gate to `None`. PR #128 itself acknowledged this in its commit message ("the macOS test was already failing on master for an unrelated reason — the test relies on a spawn notice that was dead code by the time it was written"). Fix the test to assert the post-#128 behavior: `startup_hints_for_launch` returns `None` regardless of `hotkey_configured` or `startup_spawn_hint_dismissed`. Kept the `#[cfg(target_os = "macos")]` gate so the test remains macOS-only, symmetric with other launch-hotkey notice tests in this file. Updated the docstring to record the PR #128 provenance so the test's intent is obvious to future maintainers. Also cherry-picks PR #137 (dead-code removal of `StartupHints::with_spawn_notice`) onto this branch so the branch satisfies `cargo clippy ... -D warnings` — that helper was the only `dead_code` warning in the crate, and PR #128's test retirement leaves the crate with the warning active. Both commits are required for clippy to pass. Diff scope: - crates/jcode-setup-hints/src/setup_hints_tests.rs: test body + docstring (+17/-11) - crates/jcode-setup-hints/src/lib.rs (cherry-picked from PR #137): -8 lines Validation: - cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings: exit 0 - cargo fmt -p jcode-setup-hints -- --check: exit 0 - cargo test -p jcode-setup-hints --lib setup_hints_tests::first_three_launches_can_include_hotkey_notice_too: ok - cargo test -p jcode-setup-hints --lib: 144 passed, 5 failed; same 5 pre-existing platform-specific failures as on origin/master (linux_env x2, linux_niri x2, macos_launcher x1) — none caused by this change. Closes #138 tx-agent: jcode tx-validated: test tx-task: #136 tx-scope: jcode-setup-hints tx-intent: update PR #128 broken test to assert retired spawn-notice behavior
|
Closing under the host-ops closure audit (2026-11-11): the same change already landed on master (matching commit subject); this PR is the leftover branch. The branch |
User description
Summary
Deletes the
StartupHints::with_spawn_noticeassociated function fromcrates/jcode-setup-hints/src/lib.rs. It is dead code — PR #128 removed the only call site, but the helper itself was left behind and now causes theQuality GuardrailsCI check to fail witherror: associated function \with_spawn_notice` is never used(implied by-D warnings`).Root cause
with_spawn_noticeis referenced NOWHERE on master except its own definition. Thestartup_spawn_hint_dismissedgate that used to invoke it always evaluated toNonein practice, so PR #128 ("refactor(setup-hints): remove unreachable startup spawn notice") removed all call sites but deliberately deferred the helper removal as a follow-up — recorded indocs/sessions/2026-10-18-resume-reland/00_SESSION_OVERVIEW.md(~line 113). This PR is that follow-up.Change
Single function deleted, 8 lines removed, no other code touched.
What was NOT deleted (intentional)
StartupHints::with_status_and_displaywindows_setup.rs,lib.rs(hotkey hints, keybinding hints, etc.)SetupHintsState::startup_spawn_hint_dismissedfieldfalsepersistedfn startup_hints_for_launch(_state) -> Option<StartupHints>setup_hints_tests.rsdepend on the signatureStartupHints::status_noticefieldsrc/cli/tui_launch.rs:244andcrates/jcode-setup-hints/src/setup_hints_tests.rs:272Validation
cargo clippy -p jcode-setup-hints --all-targets --all-features -- -D warnings— exit 0, no warningscargo fmt -p jcode-setup-hints -- --check— exit 0cargo test -p jcode-setup-hints --lib— same set of pre-existing platform-specific failures asorigin/master(verified by re-running against master with the patch reverted). The onesetup_hints_testsfailure (first_three_launches_can_include_hotkey_notice_too) was already broken by PR refactor(setup-hints): remove unreachable startup spawn notice #128 and is out of scope here — it tests thatstartup_hints_for_launchreturnsSome(hint)on the third launch, which no longer happens. A separate fix is needed.Ledger
Closes #136
CodeAnt-AI Description
Remove the unused startup spawn notice helper
What Changed
Impact
✅ Setup-hints checks no longer report an unused-helper warning💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.