Skip to content

Hide Dock icon when using dedicated hotkey window (GH-1154)#9926

Open
ShankyJS wants to merge 1 commit intowarpdotdev:masterfrom
ShankyJS:shankyjs/gh1154-hide-dock-icon-quake-mode
Open

Hide Dock icon when using dedicated hotkey window (GH-1154)#9926
ShankyJS wants to merge 1 commit intowarpdotdev:masterfrom
ShankyJS:shankyjs/gh1154-hide-dock-icon-quake-mode

Conversation

@ShankyJS
Copy link
Copy Markdown

@ShankyJS ShankyJS commented May 2, 2026

Description

Implements issue #1154 per spec PR #9349.

Adds a macOS-only opt-in setting under Settings → Features → Global hotkey → Dedicated hotkey window: "Hide Warp from the Dock". When the user has selected the dedicated hotkey window mode and configured a keybinding, enabling the switch flips Warp's NSApplicationActivationPolicy to Accessory so the Dock icon disappears while Warp keeps running and responds to the global hotkey.

Recovery is built into the effective-state rule, not the UI: switching away from Quake Mode, clearing the keybinding, or turning the setting off all restore the Dock icon immediately. Non-macOS platforms ignore the setting entirely (default no-op on the platform delegate trait).

Files

  • app/src/settings/mod.rshide_dock_icon: bool field on QuakeModeSettings (default false).
  • app/src/terminal/keys_settings.rs — setters, should_hide_dock_icon, apply_effective_dock_icon_visibility, and a pure compute_should_hide_dock_icon helper that the unit tests target. Re-applied from the existing set_global_hotkey_mode_… and set_quake_mode_keybinding_… paths so mode/keybinding changes immediately update Dock visibility.
  • crates/warpui_core/src/platform/mod.rsDelegate::set_dock_icon_visible(&self, bool) with default no-op.
  • crates/warpui/src/platform/mac/delegate.rs — macOS impl calls [NSApp setActivationPolicy:] on the main thread.
  • crates/warpui_core/src/core/app.rsAppContext::set_dock_icon_visible.
  • app/src/root_view.rs — applies effective state at startup right after maybe_register_global_window_shortcuts.
  • app/src/settings_view/features_page.rs — new FeaturesPageAction::QuakeEditorToggleHideDockIcon, telemetry mapping, action handler, mouse-state field, and render_quake_mode_hide_dock_icon_row rendered only inside the QuakeMode branch and gated with #[cfg(target_os = "macos")].

Testing

Automated. Six new unit tests in app/src/terminal/keys_settings.rs cover each invariant from specs/GH1154/product.md:

  • happy path (macOS + Quake Mode + opt-in + keybinding → hides)
  • default setting never hides (behaviors 2/3)
  • ActivationHotkey / Disabled mode → visible (behavior 8)
  • missing keybinding → visible (behavior 9)
  • non-macOS → visible (behavior 13)

cargo fmt, cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings, clang-format, and cargo test -p warp are all clean locally. wgslfmt and the full-workspace cargo nextest run were not executed locally (the diff doesn't touch shaders or the broader workspace), so reviewers should rely on CI for those.

Manual. A full sweep of the product-spec invariants 1–17 has not been performed. Recommended manual validation before merging:

  • enable Quake Mode + a keybinding, toggle the new switch, confirm the Dock icon disappears immediately
  • press the hotkey while hidden — window still toggles
  • clear the keybinding while the setting is on — Dock icon returns
  • switch global hotkey to "Show/hide all windows" or Disabled — Dock icon returns
  • restart with the setting on and a keybinding configured — Dock icon stays hidden from launch
  • run a long-lived command, toggle the setting on/off, confirm the session/pane survives
  • Short video for testing attached in here https://github.com/user-attachments/assets/caed1466-e126-4aac-866f-352211ce8963

Server API dependencies

None.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-NEW-FEATURE: macOS: added an option to hide Warp from the Dock while using the dedicated hotkey window (Settings → Features → Global hotkey).

Closes #1154
Spec: #9349

Adds an opt-in macOS-only setting that hides Warp's Dock icon while a
dedicated hotkey window is the active global hotkey mode and a keybinding
is configured. When effective, Warp switches NSApplicationActivationPolicy
to Accessory; otherwise it stays Regular. Off by default.

Recovery is built into the effective-state rule rather than left to the
user: clearing the keybinding, switching away from Quake Mode, or turning
the setting off restores the Dock icon immediately, so the user can never
end up without an obvious way back to the app.

Implements the spec at specs/GH1154/.
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 2, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @ShankyJS on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 2, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 2, 2026

@ShankyJS

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@ShankyJS
Copy link
Copy Markdown
Author

ShankyJS commented May 2, 2026

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 2, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 2, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a macOS-only opt-in setting for hiding Warp from the Dock while the dedicated hotkey window mode is active, wires the setting through keybinding/mode transitions, and adds platform delegate support for changing the NSApplication activation policy.

Concerns

  • For faster review, please upload screenshots or a video of the feature working end to end. This is a user-visible Settings/UI change and the provided PR context does not include visual evidence.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@ShankyJS
Copy link
Copy Markdown
Author

ShankyJS commented May 2, 2026

Hey @oz-agent thanks for the review, I've attached a video testing the feature. In the description (check for the manual testing done)

@ShankyJS
Copy link
Copy Markdown
Author

ShankyJS commented May 3, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 3, 2026

@ShankyJS

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds a macOS-only setting to hide Warp from the Dock while using the dedicated hotkey window and wires it through settings, startup, and the platform delegate.

Concerns

  • Existing persisted QuakeModeSettings values that do not include the new field can fail deserialization unless the field has a serde default.
  • The startup application path only runs when an AppState exists, so launches without persisted app state skip enforcing the saved Dock visibility setting.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/settings/mod.rs
Comment on lines +343 to +346
#[schemars(
description = "macOS only. Whether Warp should hide its Dock icon while the dedicated hotkey window is the active global hotkey mode and a keybinding is configured. Has no effect on Linux or Windows."
)]
pub hide_dock_icon: bool,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] Existing user configs serialized before this field existed will not contain hide_dock_icon; without a serde default, deserializing QuakeModeSettings can fail instead of falling back to false.

Suggested change
#[schemars(
description = "macOS only. Whether Warp should hide its Dock icon while the dedicated hotkey window is the active global hotkey mode and a keybinding is configured. Has no effect on Linux or Windows."
)]
pub hide_dock_icon: bool,
#[serde(default)]
#[schemars(
description = "macOS only. Whether Warp should hide its Dock icon while the dedicated hotkey window is the active global hotkey mode and a keybinding is configured. Has no effect on Linux or Windows."
)]
pub hide_dock_icon: bool,

Comment thread app/src/root_view.rs

if let Some(app_state) = &arg.app_state {
maybe_register_global_window_shortcuts(global_resource_handles.clone(), ctx);
KeysSettings::as_ref(ctx).apply_effective_dock_icon_visibility(ctx);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This is still inside if let Some(app_state), so launches without a persisted app state skip applying the saved Dock visibility setting; move the apply outside the if or run it from the launch path after settings load so startup always enforces the setting.

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

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide Warp icon from the Dock when using Hotkey window

1 participant