Skip to content

fix: theme update prompt and fix tool-window touch drag/placement - #107

Merged
pountzas merged 2 commits into
mainfrom
dev
Aug 12, 2026
Merged

pountzas merged 2 commits into
mainfrom
dev

Conversation

@pountzas

@pountzas pountzas commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Theme the update prompt with app surface/header colors and show it in both Mini Mode and full mode (including expand-from-FAB when needed).
  • Fix Settings/tool-window title-bar drag on touch by starting OS drag on pointerdown (Windows requires the same gesture).
  • Place tool windows with DPI-aware logical coordinates, clamp to the work area, prefer primary on mirrored duplicates, and re-anchor when reopening.

Commit message

fix: theme update prompt and fix tool-window touch drag/placement

Related issue

N/A

Accessibility impact

Touch users can move Settings again; mirrored/high-DPI setups no longer open Settings off-screen where it could not be closed. Update availability is visible in Mini Mode without leaving the accessibility workflow.

Test plan

  • Ran npm run tauri dev locally
  • Manually tested update prompt theming (light/dark color profiles) in full mode and Mini Mode
  • Manually tested Settings title-bar drag with touch and mouse
  • Manually tested Settings open position on mirrored / high-DPI display
  • npm test -- src/lib/toolWindows.test.ts

Screenshots (if UI changed)

Summary by CodeRabbit

  • New Features

    • Added an in-app prompt to notify you when an update is available.
    • Update prompts now adapt their colors to the selected theme.
    • Update notifications automatically become visible when the app is minimized or collapsed.
    • Tool windows open on the appropriate monitor with improved sizing and positioning.
  • Bug Fixes

    • Improved dragging of tool windows with mouse, touch, and pen input.
    • Improved placement across high-DPI, mirrored, and offset monitor configurations.

- Integrated an UpdatePrompt component to notify users of available updates, improving user experience during updates.
- Enhanced the AppShell to conditionally render the UpdatePrompt based on pending updates.
- Updated the ToolWindowHeader to support improved dragging functionality with touch styles.
- Refactored the useLongPressWindowDrag hook to streamline window dragging behavior.
- Adjusted styles in UpdatePrompt for better visual integration with the app's theme.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@pountzas, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bbdaf662-c480-48ce-b7e9-f5e8862ed21b

📥 Commits

Reviewing files that changed from the base of the PR and between f6fafb7 and ac11808.

📒 Files selected for processing (8)
  • src-tauri/Cargo.toml
  • src-tauri/src/window/mod.rs
  • src-tauri/src/window/windows.rs
  • src/components/common/UpdatePrompt.tsx
  • src/lib/toolWindows.test.ts
  • src/lib/toolWindows.ts
  • src/lib/types.ts
  • src/stores/appStore.ts
📝 Walkthrough

Walkthrough

The application now renders a theme-aware update prompt, ensures it is visible when updates are detected, places tool windows using logical monitor coordinates, and starts window dragging immediately on primary pointer input.

Changes

Application interaction changes

Layer / File(s) Summary
Update prompt flow and styling
src/App.tsx, src/components/common/UpdatePrompt.tsx, src/components/layout/AppShell.tsx, src/stores/appStore.ts
UpdatePrompt moved to MainApp, responds to pending updates, expands collapsed application modes, and derives colors from application settings.
Logical tool-window placement
src/lib/toolWindows.ts, src/lib/toolWindows.test.ts, src/stores/appStore.ts
Tool windows now select a target monitor, convert placement to logical coordinates, clamp dimensions, and apply resolved size and position during creation and reopening. Tests cover monitor selection and placement calculations.
Immediate window dragging
src/hooks/useLongPressWindowDrag.ts, src/components/common/ToolWindowHeader.tsx
Primary pointer input now starts window dragging immediately. Tool-window headers apply touchAction: "none" while preserving caller styles.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant appStore
  participant MainApp
  participant UpdatePrompt
  appStore->>appStore: detect update and ensure prompt visibility
  appStore->>MainApp: set pendingUpdate
  MainApp->>UpdatePrompt: render pending update
  UpdatePrompt->>MainApp: clear pending update on dismiss
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main changes to the themed update prompt, touch dragging, and tool-window placement.
Description check ✅ Passed The description includes all required sections and clearly explains the changes, accessibility impact, and test plan.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/common/UpdatePrompt.tsx`:
- Around line 82-84: Update the UpdatePrompt component’s modal wrapper to
provide dialog semantics with an accessible label and aria-modal, move initial
focus into the prompt, contain keyboard focus within it, restore focus when
dismissed, and handle Escape by calling onDismiss. Prefer the project’s tested
dialog primitive if available; otherwise implement this lifecycle around the
existing panel and update actions.

In `@src/lib/toolWindows.ts`:
- Around line 83-92: Update the mirrored-monitor selection logic around the
overlapping monitor filter to include only monitors geometrically overlapping
candidate, rather than every monitor with is_mirror_duplicate; then select the
primary or largest monitor only within that group and retain candidate as the
fallback. Add a test covering two separated mirrored groups to verify a
candidate selects no monitor from the other group.
- Around line 111-149: Update resolvePlacement and its supporting
MonitorInfo/backend monitor payload to carry each monitor’s scale factor from
cmd_list_monitors, then pass the selected monitor’s factor to centerOnMonitor
instead of using getUiScaleFactor() for the current window. Add a test covering
placement on a monitor with DPI different from the current window.

In `@src/stores/appStore.ts`:
- Around line 137-147: Update ensureUpdatePromptVisible to handle
isAnimatingWindow before invoking toggleCollapsed or expandMiniModeKeyboard:
defer or retry the expansion once the window animation completes, ensuring the
update prompt ultimately becomes visible in both collapsed and compact Mini Mode
states.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d43fae0-5db0-4b63-a5e6-ce5c29ffbba3

📥 Commits

Reviewing files that changed from the base of the PR and between ec252ab and f6fafb7.

📒 Files selected for processing (8)
  • src/App.tsx
  • src/components/common/ToolWindowHeader.tsx
  • src/components/common/UpdatePrompt.tsx
  • src/components/layout/AppShell.tsx
  • src/hooks/useLongPressWindowDrag.ts
  • src/lib/toolWindows.test.ts
  • src/lib/toolWindows.ts
  • src/stores/appStore.ts
💤 Files with no reviewable changes (1)
  • src/components/layout/AppShell.tsx

Comment thread src/components/common/UpdatePrompt.tsx Outdated
Comment thread src/lib/toolWindows.ts Outdated
Comment thread src/lib/toolWindows.ts Outdated
Comment thread src/stores/appStore.ts
- Added focus management and keyboard navigation to the UpdatePrompt component, improving accessibility for users.
- Introduced a utility function to identify focusable elements within the UpdatePrompt dialog.
- Updated the tool window management logic to utilize the monitor's DPI scale factor for better window placement.
- Enhanced tests for tool window behavior to cover new scenarios involving monitor scale factors and overlapping monitors.
- Refactored related components to ensure consistent handling of window animations and visibility states.
@pountzas
pountzas merged commit 298e579 into main Aug 12, 2026
2 checks passed
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