Skip to content

feat: resizable sidebars + draggable comments panel#177

Merged
tomasz-tomczyk merged 3 commits intomainfrom
fix/164-esc-confirm-and-resizable-sidebars
May 5, 2026
Merged

feat: resizable sidebars + draggable comments panel#177
tomasz-tomczyk merged 3 commits intomainfrom
fix/164-esc-confirm-and-resizable-sidebars

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

@tomasz-tomczyk tomasz-tomczyk commented May 5, 2026

Summary

Closes #164 — ports the resizable file-tree and comments-panel sidebars from crit/ to the hosted review surface.

  • Drag the thin handle on the inner edge of either sidebar to resize. Widths persist via localStorage (crit-file-tree-width, crit-comments-panel-width) since crit-web is served from a stable origin.
  • 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.
  • Hide handle when its panel is hidden; mobile breakpoint hides both.

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

  • Code review: passed (1 drift fixed: focus-visible style ported to crit/, dead selector removed)
  • Parity audit: in sync with crit/

Test plan

  • mix compile clean
  • mix format clean
  • Manual drag verified

🤖 Generated with Claude Code

tomasz-tomczyk and others added 3 commits May 5, 2026 21:40
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.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.14%. Comparing base (247b262) to head (eff85f9).

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           
Flag Coverage Δ
unit 79.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit 8acd15f into main May 5, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix/164-esc-confirm-and-resizable-sidebars branch May 5, 2026 21:26
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.

Parity drift from crit v0.10.4: Esc-confirm on draft + resizable sidebars

1 participant