Skip to content

🤖 fix: command palette shows the Keep Screen Awake state - #5799

Merged
ThomasK33 merged 1 commit into
mainfrom
fix/palette-config-toggles-5791
Oct 6, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
fix/palette-config-toggles-5791

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

"Toggle Keep Screen Awake" in the command palette now shows its state ("Current: On" or "Current: Off"), like the palette toggles backed by local state.

Fixes #5791

Changes

  • sources.ts: the toggle's subtitle comes from a new getKeepScreenAwake param. While the config has not loaded (undefined), the subtitle keeps the old description and does not guess a state.
  • AppConfigStore.ts: the shared app config cache now also keeps keepScreenAwake. The store makes one getConfig fetch and holds one onConfigChanged subscription per session, so the value stays current after a toggle from the palette or from Settings.
  • App.tsx: passes getKeepScreenAwake, which reads the store's snapshot when the palette builds its actions. There is no new IPC method, no per-render call, and no persisted field (keepScreenAwake is already in config.getConfig).

The issue also names "Toggle Count AI Calls from Bash Commands". That action comes from the unmerged #5772, so this PR does not touch it. When it lands, it can use the same describeConfigToggle helper with its own store field. The optional toast after a toggle is out of scope.

Validation

Test written first. It failed on main:

(fail) toggle keep screen awake shows the loaded config value
  Expected: "Current: On"
  Received: "Prevent display sleep while agents are working"

After the fix, bun test ./src/browser/utils/commands/ shows 93 pass and 0 fail. make typecheck and make static-check pass.

Dogfood: the bug-bash app on main and on this branch, driven by Playwright. The toggle exists only in the desktop app (it needs window.api), so the script sets the same window.api stub the unit tests use, after the page loads. It opens the palette (F4), types "keep screen awake", runs the toggle, and reopens:

                       main                                              this branch
first open             "Prevent display sleep while agents are working"  "Current: Off"
after the toggle       "Prevent display sleep while agents are working"  "Current: On"
Main This branch This branch, 390px
Main: no state shown Branch: Current: Off Branch at 390px: Current: On

Risks

Low. One subtitle and one more field in an existing cache.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T20:55:08.557086Z cee0d08 PR opened
🔒 Security Review ✅ Completed 2026-10-06T20:55:15.222387Z cee0d08 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

Ready to merge at head cee0d08dca.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 8801926 Oct 6, 2026
33 checks passed
@ThomasK33
ThomasK33 deleted the fix/palette-config-toggles-5791 branch October 6, 2026 21:37
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.

🤖 Command palette: config-backed toggles show no current state

1 participant