Skip to content

fix(setup-hints): align launch-hotkey markers with the kcode decollation - #120

Closed
KooshaPari wants to merge 1 commit into
masterfrom
fix/setup-hints-conflicts-keymap-decollation
Closed

KooshaPari wants to merge 1 commit into
masterfrom
fix/setup-hints-conflicts-keymap-decollation

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

User description

Six tests in jcode-setup-hints fail on master. Five are decollation residue; the sixth is a stale test.

Root cause

Commit 6cf71ed4e flipped the dconf slot names, the GNOME merge filter and the slot doc comments to kcode-launch-, but left four sites on the old jcode- form:

Site File Was
gnome_keybinding_path() linux_env.rs:355 jcode-launch-
upsert_kde_shortcut_sections() skip linux_env.rs:551 [services][jcode-launch-
linux_hotkeys_installed() gnome lib.rs:1550 /jcode-launch-
linux_hotkeys_installed() kde lib.rs:1560 [services][jcode-launch-
niri focused-window app_id linux_niri.rs:172 jcode-desktop

Three of those are live bugs, not naming noise:

  1. Stale slots accumulate. gnome_keybinding_path() wrote jcode-launch-* but merge_gnome_keybinding_list() only strips kcode-launch-*. Re-installs append instead of replacing.
  2. Detection lies permanently. linux_hotkeys_installed() searches for the name the installer never writes, so gnome and kde always report "not installed".
  3. Niri forwarding never fires. The router forwards desktop sessions only while jcode-desktop is focused; the shipped package is kcode-desktop, so the condition never matched.

Direction

kcode- is canonical. desktop_selfdev.rs builds -p kcode-desktop, and the notification broker plus ~/.kcode/ are already kcode--named across two crates. Normalise all 13 sites onto kcode-.

The sixth failure

first_three_launches_can_include_hotkey_notice_too was stale, not residue. The system-wide spawn notice has been opt-in (startup_spawn_hint_dismissed: true by default, with nothing ever setting it false) since ea791a57f. 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 (5c2c91a52 fixed conflicts.rs:474).

Verification

Check Before After
cargo test -p jcode-setup-hints --lib 143 passed; 6 failed 149 passed; 0 failed; 0 ignored
cargo fmt -p jcode-setup-hints -- --check clean clean
cargo check -p jcode-setup-hints --release --lib — clean, no warnings

No crate outside jcode-setup-hints references the changed custom-keybindings path, 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

  • GNOME and KDE now use the same launch-hotkey names for installing shortcuts and detecting whether they are installed.
  • Reinstalling GNOME or KDE shortcuts replaces existing kcode launch entries instead of leaving duplicates.
  • Niri now forwards launch shortcuts when the kcode desktop is focused.

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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
Copilot AI balanced review requested due to automatic review settings October 18, 2026 01:38
@codeant-ai

codeant-ai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 6747260 Oct 18, 2026 · 01:38 01:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9e0d5e34-cb99-4a68-8cab-d6590627baac
📥 Commits

Reviewing files that changed from the base of the PR and between 39f2ea7 and 6747260.

📒 Files selected for processing: 5
  • crates/jcode-setup-hints/src/lib.rs
  • crates/jcode-setup-hints/src/linux_env.rs
  • crates/jcode-setup-hints/src/linux_niri.rs
  • crates/jcode-setup-hints/src/macos_launcher_tests.rs
  • crates/jcode-setup-hints/src/setup_hints_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 18, 2026
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}/"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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-");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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; "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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-ai

codeant-ai Bot commented Oct 18, 2026

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging because upgrades can retain old hotkey entries and stale commands.
  • GNOME list merging and KDE section replacement now match only kcode-launch names, leaving existing jcode-launch entries untouched.
  • When kcode-desktop is focused, a missing wtype makes the hotkey command exit instead of opening the terminal.

Assessed commit: 674726070d76

@KooshaPari

Copy link
Copy Markdown
Owner Author

Superseded by #121.

PR #121 is a fresh cherry-pick of this same commit onto a clean branch off
master, with no stacked changes. This PR (which is on the same single
commit anyway) can be closed — the merge target is identical and the
canonical implementation lives on #121.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants