Skip to content

fix(desktop-gpui): keep the space above the recording bar clickable - #3509

Merged
richiemcilroy merged 4 commits into
mainfrom
fix/gpui-controls-click-through
Oct 28, 2026
Merged

richiemcilroy merged 4 commits into
mainfrom
fix/gpui-controls-click-through

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

The recording controls window was a fixed 320 by 150 pt with the bar pinned to its bottom, leaving about 86 pt of transparent space above the bar. A transparent window still takes every click inside its frame, so whatever sat under that strip (a browser tab, a button) could not be clicked while recording.

The window is now only as tall as the bar (64 pt) on macOS and Windows. It grows upward to the old 150 pt only while the error or low-storage card is showing above the bar, and shrinks back when the card goes. The bar stays exactly where it was in both cases.

  • macOS: AppKit frames have a bottom-left origin, so changing the height keeps the bar in place.
  • Windows: the frame is physical pixels from the top-left, so the origin moves up by the added height.
  • Linux keeps the 150 pt window: it has no frame helper to resize it in place.

The resize runs from a task, because setFrame re-enters gpui.

Test plan

  • macOS, real Studio recording on the Mac mini: the window is 320 by 64 pt with no issue, so nothing covers the app above the bar
  • Windows build in CI
  • Low-storage card and a long error card each grow the window to 150 pt and show in full above the bar; the bar does not move (bottom edge stays put), and the window shrinks back to 64 pt when the error clears
  • Pause tooltip places the same as on main

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous findings are fixed.

Summary

The PR keeps the space above the recording bar clickable by shrinking its window on macOS and Windows, then growing it when an issue card appears.

  • The recording-controls window only covers the bar unless an issue card needs room.

Reviews (3) · Last reviewed commit: "chore(desktop-gpui): drop two comments t..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cap-status Ready Ready Preview Oct 28, 2026 1:24pm UTC

@capy-ai capy-ai Bot 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.

Capy found 1 potential issue (1 medium).

View 1 other finding in Capy.

Open in Capy

#[cfg(windows)]
{
let height = height * f64::from(scale);
platform::set_window_frame(native, x, y + current - height, width, height);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Expanding controls near the top clips the issue card

Medium Severity

On Windows at 100% scaling, a compact controls window at y=16 has its bottom at y=80. When a storage warning or recording error appears, this resize moves its top to -70, placing much of the issue card off-screen. This position is reachable by dragging the bar or by the initial work-area clamp for a short recording target near the screen's top. Previously the entire 150-point window was clamped into the work area. Clamp the expanded frame to the current display's work area, allowing the bar to move when necessary to keep the warning visible.

Open in Capy

_tick: gpui::Task<()>,
ticking_live: bool,
level_bar: Entity<ui::MicrophoneLevel>,
/// Whether the window is sized for the issue card.

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.

P2 Comment repeats the field

The new comment on issue_room only restates what the field stores. AGENTS.md allows comments only when they explain non-obvious context and explicitly bans comments that narrate the code. Remove this comment before merging to meet that requirement. The platform-coordinate and re-entry comments explain non-obvious constraints and can stay.

Suggested change
/// Whether the window is sized for the issue card.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/controls_window.rs
Line: 39

Comment:
**Comment repeats the field**

The new comment on `issue_room` only restates what the field stores. `AGENTS.md` allows comments only when they explain non-obvious context and explicitly bans comments that narrate the code. Remove this comment before merging to meet that requirement. The platform-coordinate and re-entry comments explain non-obvious constraints and can stay.

```suggestion

```

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@capy-ai capy-ai Bot 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.

Capy found no issues.

Open in Capy

@capy-ai capy-ai Bot 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.

Capy found no issues.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai the narrating comment on issue_room was removed in 37ab805; please re-review.

Comment thread apps/desktop-gpui/src/app_windows.rs Outdated
/// Matches the Tauri `InProgressRecording` window and
/// `fake_window.rs` position math.
pub const CONTROLS_WIDTH: f32 = 320.;
/// The window's height with an issue card above the bar.

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.

P2 Comments repeat the code

The new comments above CONTROLS_HEIGHT and CONTROLS_FIT_TO_ISSUE only describe their declarations. AGENTS.md bans comments that narrate code and allows only non-obvious context. Remove these two comments before merging to meet that requirement. Keep the explanations about clicks, platform coordinates, and re-entry.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop-gpui/src/app_windows.rs
Line: 43

Comment:
**Comments repeat the code**

The new comments above `CONTROLS_HEIGHT` and `CONTROLS_FIT_TO_ISSUE` only describe their declarations. `AGENTS.md` bans comments that narrate code and allows only non-obvious context. Remove these two comments before merging to meet that requirement. Keep the explanations about clicks, platform coordinates, and re-entry.

**Context Used:** AGENTS.md ([source](https://github.com/capsoftware/cap/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai removed both comments in 4adb866; please re-review.

@capy-ai capy-ai Bot 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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy
richiemcilroy merged commit 2013d15 into main Oct 28, 2026
58 checks passed

This branch was successfully deployed

2 active deployments
Preview – cap-web — 4adb8661 Deployed Oct 28, 2026 by vercel[bot]
Preview – cap-status — 4adb8661 Deployed Oct 28, 2026 by vercel[bot]
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.

1 participant