Skip to content

feat: intercept browser save shortcut - #48

Merged
CPunisher merged 2 commits into
rstackjs:mainfrom
intellild:intercept-save-shortcut
Jul 28, 2026
Merged

feat: intercept browser save shortcut#48
CPunisher merged 2 commits into
rstackjs:mainfrom
intellild:intercept-save-shortcut

Conversation

@intellild

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60fce8a132

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/App.tsx Outdated
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 37ba28f0-aeb2-42cb-a8fb-222e2e74ce67

📥 Commits

Reviewing files that changed from the base of the PR and between 60fce8a and 0366327.

📒 Files selected for processing (1)
  • src/App.tsx
📝 Walkthrough

Walkthrough

Added react-use version ^17.6.1 and used its useEvent hook in App to capture keydown events. The handler detects Ctrl+S and Cmd+S, prevents the browser’s default save behavior, and stops event propagation while the app is mounted.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so the description check can't confirm relevance. Add a brief description that explains the save-shortcut interception and any related dependency changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: intercepting the browser save shortcut.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 1

🧹 Nitpick comments (1)
src/App.tsx (1)

8-18: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the shortcut contract.

Test plain Ctrl/Cmd+S, unrelated keys, modified variants, preventDefault(), propagation behavior, and listener cleanup when App unmounts.

🤖 Prompt for 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.

In `@src/App.tsx` around lines 8 - 18, Add regression tests for the keydown
handler registered by App, covering plain Ctrl/Cmd+S, unrelated keys, modified
variants, preventDefault and stopPropagation behavior, and removal of the
listener when App unmounts. Use the existing event-listener test patterns and
verify the shortcut contract without changing the handler implementation.
🤖 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/App.tsx`:
- Around line 11-14: Update the keyboard handler condition around the Ctrl/Cmd+S
interception to require both shiftKey and altKey to be false, while preserving
the existing Ctrl/Cmd modifier and lowercase “s” checks. This should prevent
interception of Ctrl/Cmd+Shift+S and Ctrl/Cmd+Alt+S so those shortcuts continue
to the editor.

---

Nitpick comments:
In `@src/App.tsx`:
- Around line 8-18: Add regression tests for the keydown handler registered by
App, covering plain Ctrl/Cmd+S, unrelated keys, modified variants,
preventDefault and stopPropagation behavior, and removal of the listener when
App unmounts. Use the existing event-listener test patterns and verify the
shortcut contract without changing the handler implementation.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7b56aa0-ef89-4c55-9579-6afcfc675e50

📥 Commits

Reviewing files that changed from the base of the PR and between 7e33bee and 60fce8a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/App.tsx

Comment thread src/App.tsx Outdated
@CPunisher
CPunisher merged commit 0e185aa into rstackjs:main Jul 28, 2026
1 check 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.

2 participants