feat: resizable sidebars + draggable comments panel#177
Merged
tomasz-tomczyk merged 3 commits intomainfrom May 5, 2026
Merged
Conversation
Drag the thin handle on the inner edge of either sidebar to widen or narrow it. Widths persist via localStorage (crit-web is served from a stable origin, unlike the local CLI's random-port server). Handles use role="separator" with tabindex="0" and ArrowLeft/ArrowRight keyboard support (16px steps, clamped to min 180 file-tree / 300 comments). No upper bound — ultrawide users may legitimately want very wide sidebars. Mirrors the equivalent feature in crit/ (issue #164). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The comments panel was created without an id, so initSidebarWidths()'s
document.getElementById('commentsPanel') returned null, the SIDEBAR_RESIZE
loop bailed out early on that config (`if (!target) return`), and
attachSidebarResizeHandle() was never called for #commentsPanelResizer.
File-tree handle worked because #fileTreePanel is server-rendered with
the id in the heex template.
Add `commentsPanel.id = 'commentsPanel'` when constructing the panel so
the resize handle gets its pointerdown/keydown listeners.
This crit-web frontend toggles the panel via .comments-panel-open; .comments-panel-hidden is never set (it's the crit/ local convention, not crit-web's). The :has(#commentsPanel.comments-panel-hidden) selector never matched anything. The :not(.comments-panel-open) selector still does the work.
4 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
=======================================
Coverage 79.14% 79.14%
=======================================
Files 56 56
Lines 1817 1817
=======================================
Hits 1438 1438
Misses 379 379
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #164 — ports the resizable file-tree and comments-panel sidebars from crit/ to the hosted review surface.
localStorage(crit-file-tree-width,crit-comments-panel-width) since crit-web is served from a stable origin.role="separator"withtabindex="0"and ArrowLeft/ArrowRight keyboard support (16px steps, clamped to min 180 file-tree / 300 comments). No upper bound.P1 (Esc-confirm on non-empty comment draft) was already implemented at HEAD via
confirmDiscardIfDirty— no code change needed.Companion: tomasz-tomczyk/crit#469 (sibling a11y change for keyboard-accessible handles in the local CLI).
Review
Test plan
🤖 Generated with Claude Code