Skip to content

refactor(browser): move the grab hook type to its owner - #36087

Merged
AmoabaKelvin merged 2 commits into
mainfrom
browser-annotation-type-owner
Oct 29, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
browser-annotation-type-owner

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​30 $\color{#cf222e}{\Huge{\mathbf{−}}}$​32 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

ELI5

Keep the combined annotation changes within the repository's file-size limit by moving the grab hook's return type beside its existing option and toast types.

What Changed

The return type moves unchanged to browser-page-types.ts. The hook imports it instead of declaring it inline. No runtime code changes.

Why

The annotation-limit and image-paste changes each passed separately. Together they left the hook at 304 counted lines against a 300-line cap. Moving its type to the existing owner restores the limit without changing behavior.

Linked Issue

Follow-up to #35979 and #36004.

Visual Proof

N/A. Type declarations move without changing rendered output or behavior.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The existing grab-annotation suite passes, 6 tests. Focused oxlint, formatting, and git diff --check pass on macOS. No new tests are needed for moving a type unchanged. CI covers typechecking and the remaining checks.

AI Disclosure

Review

Compared the moved type with the original declaration. Properties and function signatures are unchanged; React type imports remain in the existing types module.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Type-only change. Platform behavior, SSH, mobile, wire compatibility, and performance remain unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Local focused checks pass; CI will cover full lint, typecheck, tests, and build

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Moves the return type for useBrowserPageGrabAnnotations into browser-page-types.ts.

  • The browser grab hook gets its return type from the browser-page types.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into browser-annotat..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

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

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 14a59658-f1d0-4e8c-8fee-b50d91679aba
Commits

Reviewing files that changed from the base of the PR and between 661b237 and 75b8fd0.

Files selected for processing: 2
  • src/renderer/src/components/browser-pane/annotate/use-browser-page-grab-annotations.ts
  • src/renderer/src/components/browser-pane/describe-page/browser-page-types.ts
Walkthrough

The change adds the BrowserPageGrabAnnotations type to describe the annotation hook’s return value. The hook now declares this shared type instead of an inline object shape. The type module also imports and re-exports GrabIntent.

Priority: Low

Merge Risk: Minimal · previous review 661b2

The change appears limited to a type extraction; no merge-blocking issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the change: moving the grab hook's type to the module that owns it. The raw summary confirms the return type of useBrowserPageGrabAnnotations now uses BrowserPageGrabAnnotations, defin…
Description check Passed The description follows the template well. It has ELI5, What Changed, Why, Linked Issue (follow-up to #35979 and #36004), Visual Proof marked N/A with a reason, Testing with results, Review, Agent ski…
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.
Full details: Title check

Explanation

The title names the change: moving the grab hook's type to the module that owns it. The raw summary confirms the return type of useBrowserPageGrabAnnotations now uses BrowserPageGrabAnnotations, defined in browser-page-types.ts. The title is specific and matches the changeset. The 'refactor(browser)' prefix is a conventional-commit style, which is acceptable.

Full details: Description check

Explanation

The description follows the template well. It has ELI5, What Changed, Why, Linked Issue (follow-up to #35979 and #36004), Visual Proof marked N/A with a reason, Testing with results, Review, Agent skill boundary, Notes, and Checklist. It explains the before and after and the mechanism. Gaps: the Linked Issue section uses 'Follow-up to' instead of the 'Fixes #' form, which is acceptable for a follow-up change. The AI Disclosure section is empty, but the template says to skip it for StablyAI team members, so this is not a defect if the author is internal. The manual testing box is unchecked while the automated tests box is checked, and the text says the tests were run locally, so the unchecked box is inconsistent.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@AmoabaKelvin
AmoabaKelvin merged commit 63f6d83 into main Oct 29, 2026
41 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.

2 participants