Skip to content

Keep the Ariakit comment toolbar reachable in narrow sidebars - #3469

Open
yucheng-du wants to merge 1 commit into
TypeCellOS:mainfrom
yucheng-du:fix/ariakit-comment-toolbar
Open

yucheng-du wants to merge 1 commit into
TypeCellOS:mainfrom
yucheng-du:fix/ariakit-comment-toolbar

Conversation

@yucheng-du

@yucheng-du yucheng-du commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

In a 360px comments sidebar, the Ariakit reply toolbar is 472px wide. Selecting reply text makes the whole sidebar scroll horizontally. In a right-hand sidebar the last two controls, Align right and Create link, can be clipped.

Position the toolbar against the viewport with Floating UI's fixed strategy. It stays attached to the selection and uses the existing comment editor portal. Refs #3437.

Testing

  • A browser regression checks that Create link receives pointer hits before a locator can scroll it into view. It failed on main and passed with this change in Chromium, Firefox and WebKit.
  • In the 360px example layout, all nine controls received pointer hits and the sidebar kept its original scroll width. The toolbar followed the reply offscreen when the sidebar scrolled. A separate new floating comment also kept all nine controls reachable in all three engines.
  • Ariakit builds and type-checks. The new test was green across all three engines. Across the sidebar, comment action and link button suites, 40 checks passed, 3 were expected failures and 11 failed on local WebKit. I ran the same cases on unmodified main and confirmed each of those 11 failures there.

Create link opened with the keyboard in all three engines and with a pointer in Chromium and Firefox. Local WebKit hit the button but did not show the link form. I reproduced that separately on unmodified main with a 680px sidebar where the button was already reachable.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the comments formatting toolbar’s positioning, helping keep formatting controls accessible in narrow sidebars without horizontal overflow.

@vercel

vercel Bot commented Dec 2, 2026

Copy link
Copy Markdown

@yucheng-du is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The comments editor now configures its formatting toolbar to use fixed positioning. A browser test checks toolbar access and horizontal overflow in a 360px-wide Ariakit comments sidebar.

Changes: Comment toolbar positioning

Layer / File(s) Summary
Fixed toolbar positioning and sidebar check
packages/ariakit/src/comments/Editor.tsx, packages/react/src/components/Comments/ThreadsSidebar.browser.test.tsx
The editor passes strategy: "fixed" through floatingUIOptions. The browser test checks that the link button is visible and hit-testable without sidebar scrolling, and that the sidebar has no horizontal overflow.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Suggested reviewers: nperez0111, matthewlipski

Merge Risk: Minimal · up to 43d7c

This change keeps the comment formatting toolbar reachable in narrow sidebars by using fixed positioning, and it adds a regression test. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: keeping the Ariakit comment toolbar reachable in narrow sidebars. The PR positions the toolbar with Floating UI's fixed strategy so it no longer widens the 360px sideb…
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.
Description check Passed The description follows the repository template. It has a clear Summary that explains the 360px sidebar clipping problem and the fixed-strategy fix, and it links issue #3437. It also has a Testing sec…
Full details: Title check

Explanation

The title names the main change: keeping the Ariakit comment toolbar reachable in narrow sidebars. The PR positions the toolbar with Floating UI's fixed strategy so it no longer widens the 360px sidebar's horizontal scroll area or clips the Align right and Create link controls. The title is specific and matches the objectives and the changed files.

Full details: Description check

Explanation

The description follows the repository template. It has a clear Summary that explains the 360px sidebar clipping problem and the fixed-strategy fix, and it links issue #3437. It also has a Testing section with concrete browser, layout, and engine results. The Rationale, Changes, Impact, Screenshots/Video, Checklist, and Additional Notes sections are missing or only implied. Those gaps are non-critical, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • 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

A rabbit taps the toolbar bright,
Fixed in place and clear in sight.
The link button waits within reach,
No sideways scroll to cross the beach.
The sidebar keeps its borders neat.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f4a1178-94a2-4300-8b1f-43395f021786
Commits

Reviewing files that changed from the base of the PR and between f25b05d and 43d7cb3.

Files selected for processing: 2

  • packages/ariakit/src/comments/Editor.tsx
  • packages/react/src/components/Comments/ThreadsSidebar.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

This branch has not been deployed

No deployments
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