Repository navigation
fix(setup-hints): align launch-hotkey markers with the kcode decollation - #120
KooshaPari wants to merge 1 commit into
Conversation
Six tests in jcode-setup-hints failed on master. Five were decollation residue: 6cf71ed flipped the dconf slot names, the GNOME merge filter and the slot comments to `kcode-launch-`, but left the GNOME dconf path, the KDE INI skip matcher, the GNOME/KDE install detectors and the niri focused-window app_id on the old `jcode-` forms. That split was not cosmetic. `gnome_keybinding_path()` wrote `jcode-launch-*` while `merge_gnome_keybinding_list()` only stripped `kcode-launch-*`, so stale keybinding slots accumulated on every re-install instead of being replaced. `linux_hotkeys_installed()` searched for the name the installer never wrote, so gnome and kde both reported 'not installed' permanently. The niri router forwarded desktop sessions only while `jcode-desktop` was focused, which never matches the shipped `kcode-desktop` package. kcode- is the canonical direction: `desktop_selfdev.rs` builds `-p kcode-desktop`, and the notification broker and `~/.kcode/` are already kcode-named across two crates. Normalise all 13 sites onto kcode-, and update the four test fixtures that used the stale form as their 'stale slot' input. The sixth failure was a stale test, not residue: the system-wide spawn notice has been opt-in (`startup_spawn_hint_dismissed: true` by default, nothing sets it false) since ea791a5, but the test built default state and expected a notice. Opt it in explicitly. Also retracts the earlier report that master fails to compile this crate: that was observed against a stale checkout; on current master the crate compiles clean (5c2c91a fixed conflicts.rs:474). Verified: 149 passed; 0 failed; 0 ignored (was 143 passed; 6 failed). cargo fmt --check clean. release --lib check clean, no warnings. tx-agent: jcode tx-validated: test tx-scope: jcode-setup-hints tx-intent: make launch-hotkey install and detection agree on kcode naming
🤖 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 · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| pub(crate) fn gnome_keybinding_path(index: usize) -> String { | ||
| format!( | ||
| "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/jcode-launch-{index}/" | ||
| "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/kcode-launch-{index}/" |
There was a problem hiding this comment.
Suggestion: On upgrade, old jcode-launch-* paths remain in GNOME’s custom list while new kcode-launch-* paths are added, leaving both sets of bindings active, including stale commands.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Stale reference
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-setup-hints/src/linux_env.rs
**Line:** 355:355
**Comment:**
*Stale Reference: On upgrade, old `jcode-launch-*` paths remain in GNOME’s custom list while new `kcode-launch-*` paths are added, leaving both sets of bindings active, including stale commands.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| for line in current.lines() { | ||
| if line.starts_with('[') { | ||
| skipping = line.starts_with("[services][jcode-launch-"); | ||
| skipping = line.starts_with("[services][kcode-launch-"); |
There was a problem hiding this comment.
Suggestion: On upgrade, KDE’s old jcode-launch-* sections are no longer skipped, so they remain active alongside the new sections and can keep launching stale commands.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Stale reference
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-setup-hints/src/linux_env.rs
**Line:** 551:551
**Comment:**
*Stale Reference: On upgrade, KDE’s old `jcode-launch-*` sections are no longer skipped, so they remain active alongside the new sections and can keep launching stale commands.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| .map(|keys| { | ||
| format!( | ||
| "if [ \"$(niri msg -j focused-window 2>/dev/null | jq -r '.app_id // empty' 2>/dev/null)\" = 'jcode-desktop' ]; then exec wtype {keys}; fi; " | ||
| "if [ \"$(niri msg -j focused-window 2>/dev/null | jq -r '.app_id // empty' 2>/dev/null)\" = 'kcode-desktop' ]; then exec wtype {keys}; fi; " |
There was a problem hiding this comment.
Suggestion: If wtype is missing, exec exits the hotkey shell whenever kcode-desktop is focused; the terminal launch never runs, and setup does not detect the missing dependency.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Incomplete implementation
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-setup-hints/src/linux_niri.rs
**Line:** 172:172
**Comment:**
*Incomplete Implementation: If `wtype` is missing, `exec` exits the hotkey shell whenever `kcode-desktop` is focused; the terminal launch never runs, and setup does not detect the missing dependency.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
CodeAnt PR Risk: Medium Risk
Assessed commit: |
User description
Six tests in
jcode-setup-hintsfail on master. Five are decollation residue; the sixth is a stale test.Root cause
Commit
6cf71ed4eflipped the dconf slot names, the GNOME merge filter and the slot doc comments tokcode-launch-, but left four sites on the oldjcode-form:gnome_keybinding_path()linux_env.rs:355jcode-launch-upsert_kde_shortcut_sections()skiplinux_env.rs:551[services][jcode-launch-linux_hotkeys_installed()gnomelib.rs:1550/jcode-launch-linux_hotkeys_installed()kdelib.rs:1560[services][jcode-launch-app_idlinux_niri.rs:172jcode-desktopThree of those are live bugs, not naming noise:
gnome_keybinding_path()wrotejcode-launch-*butmerge_gnome_keybinding_list()only stripskcode-launch-*. Re-installs append instead of replacing.linux_hotkeys_installed()searches for the name the installer never writes, so gnome and kde always report "not installed".jcode-desktopis focused; the shipped package iskcode-desktop, so the condition never matched.Direction
kcode-is canonical.desktop_selfdev.rsbuilds-p kcode-desktop, and the notification broker plus~/.kcode/are alreadykcode--named across two crates. Normalise all 13 sites ontokcode-.The sixth failure
first_three_launches_can_include_hotkey_notice_toowas stale, not residue. The system-wide spawn notice has been opt-in (startup_spawn_hint_dismissed: trueby default, with nothing ever setting it false) sinceea791a57f. The test built default state and still expected a notice. It now opts in explicitly; the flag's opt-in semantics are unchanged.Retraction
My earlier report that master fails to compile this crate is retracted. That was observed against a stale checkout; on current master it compiles clean (
5c2c91a52fixedconflicts.rs:474).Verification
cargo test -p jcode-setup-hints --libcargo fmt -p jcode-setup-hints -- --checkcargo check -p jcode-setup-hints --release --libNo crate outside
jcode-setup-hintsreferences the changedcustom-keybindingspath, so the blast radius is contained to this crate.tx-agent: jcode
tx-validated: test
tx-scope: jcode-setup-hints
tx-intent: make launch-hotkey install and detection agree on kcode naming
CodeAnt-AI Description
Align Linux launch hotkeys with the kcode desktop name
What Changed
Impact
✅ GNOME and KDE setup status is detected correctly✅ Fewer duplicate launch shortcuts after reinstall✅ Niri shortcuts work with the focused kcode desktop💡 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.