Skip to content

Make concept detail panel resizable and collapsible - #10

Merged
emilio-balda merged 1 commit into
mainfrom
feat/collapse-right-bar
Sep 7, 2026
Merged

emilio-balda merged 1 commit into
mainfrom
feat/collapse-right-bar

Conversation

@emilio-balda

Copy link
Copy Markdown
Collaborator

Summary

Users can now resize (horizontally) and collapse the right-hand concept detail panel.

  • Added a header toggle button (PanelRight icon) to show/hide the detail panel, mirroring the existing left sidebar toggle button/pattern.
  • Added a drag handle on the detail panel's left edge to resize it horizontally, clamped between 260px and 640px, driven by a --detail-width CSS variable on the .workspace grid.
  • Detail.jsx is unchanged — the panel's size/visibility is purely a layout concern handled in App.jsx (state + handlers) and styles.css (grid columns + resize handle styling).
  • No persistence (localStorage) for width/collapsed state, matching how sidebarOpen itself isn't persisted, to keep the diff minimal.

Testing

  • npx vitest run — 22/22 tests passing (no test changes needed).
  • npm run build — builds successfully.
  • Manually verified in a live browser: collapse/expand toggle works, and dragging the resize handle 100px changed the panel width from 340px to 440px with no console errors.

Made with Cursor

- Add a header toggle button (PanelRight icon) to show/hide the
  right-hand concept detail panel, mirroring the existing left
  sidebar toggle.
- Add a drag handle on the detail panel's left edge to resize it
  horizontally (clamped between 260px and 640px), driven by a
  --detail-width CSS variable on the workspace grid.
- Detail.jsx is unchanged; the panel's size/visibility is purely a
  layout concern handled in App.jsx and styles.css.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 09:10
@emilio-balda emilio-balda self-assigned this Sep 7, 2026
@emilio-balda
emilio-balda merged commit 4fa7891 into main Sep 7, 2026
1 check passed

Copilot AI 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.

🟡 Changes recommended

The current resize implementation has an accessibility gap (no keyboard support) and can leak pointer listeners on pointer cancel/blur scenarios.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a collapsible and horizontally resizable right-hand concept detail panel by introducing new layout state in App.jsx and driving the workspace grid’s detail column width via a CSS custom property in styles.css.

Changes:

  • Added detailOpen / detailWidth state and a header toggle button (PanelRight) to show/hide the detail panel.
  • Added a pointer-driven resize handle to adjust the detail panel width with min/max clamping.
  • Updated workspace layout CSS to use --detail-width and to collapse the grid to fewer columns when the detail panel is closed.
File summaries
File Description
src/App.jsx Adds detail panel toggle + resize handle and wires width/visibility into workspace layout state.
src/styles.css Updates workspace grid columns to use --detail-width, adds detail-pane/resize-handle styling, and handles collapsed layout.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/App.jsx
Comment on lines +89 to +106
function handleDetailResizeStart(event) {
event.preventDefault();
const startX = event.clientX;
const startWidth = detailWidth;

function handleMove(moveEvent) {
const nextWidth = startWidth + (startX - moveEvent.clientX);
setDetailWidth(Math.min(MAX_DETAIL_WIDTH, Math.max(MIN_DETAIL_WIDTH, nextWidth)));
}

function handleUp() {
document.removeEventListener("pointermove", handleMove);
document.removeEventListener("pointerup", handleUp);
}

document.addEventListener("pointermove", handleMove);
document.addEventListener("pointerup", handleUp);
}
Comment thread src/App.jsx
Comment on lines +219 to +225
<div
className="detail-resize-handle"
role="separator"
aria-orientation="vertical"
aria-label="Resize concept detail panel"
onPointerDown={handleDetailResizeStart}
/>
Comment thread src/styles.css
Comment on lines +495 to +500
.detail-pane {
position: relative;
min-width: 0;
min-height: 0;
overflow: hidden;
}
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