Feat/resizable panes#1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds drag-resizable left (tree) and right (preview) panes to the FileManaty fullscreen overlay, persisting widths per-browser and allowing quick reset to defaults.
Changes:
- Introduces a new
web/resize.jsmodule implementing pointer-driven gutter resizing with min-width clamps andlocalStoragepersistence. - Integrates resizable gutters into the overlay layout/CSS and initializes the behavior on overlay init.
- Updates documentation and bumps version/changelog for the new feature.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/resize.js | New drag-to-resize implementation for tree/preview panes with persistence and reset behavior. |
| web/filemanaty.js | Hooks the resizer into the overlay and adds gutter styling; adjusts pane borders to use gutters. |
| README.md | Documents drag-resizable panes feature. |
| filemanaty/init.py | Bumps package version to 0.10.0. |
| CHANGELOG.md | Adds v0.10.0 entry describing resizable panes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+23
to
+26
| function readStored(key) { | ||
| const v = parseInt(localStorage.getItem(key), 10); | ||
| return Number.isFinite(v) && v > 0 ? v : null; | ||
| } |
Comment on lines
+28
to
+31
| export function initPaneResize(bodyEl) { | ||
| const treeEl = bodyEl.querySelector("#fm-tree"); | ||
| const previewEl = bodyEl.querySelector("#fm-preview"); | ||
|
|
Comment on lines
+107
to
+116
| gutTree.addEventListener("dblclick", () => { | ||
| localStorage.removeItem(LS_TREE); | ||
| treeCol = DEFAULT_TREE; | ||
| applyColumns(bodyEl, treeCol, previewCol); | ||
| }); | ||
| gutPreview.addEventListener("dblclick", () => { | ||
| localStorage.removeItem(LS_PREVIEW); | ||
| previewCol = DEFAULT_PREVIEW; | ||
| applyColumns(bodyEl, treeCol, previewCol); | ||
| }); |
Comment on lines
+76
to
+93
| function onUp() { | ||
| document.removeEventListener("pointermove", onMove); | ||
| document.removeEventListener("pointerup", onUp); | ||
| document.body.style.userSelect = prevUserSelect; | ||
| document.body.style.cursor = ""; | ||
| if (!moved) return; // a plain click should not freeze a % default to px | ||
| if (which === "tree") { | ||
| localStorage.setItem( | ||
| LS_TREE, String(Math.round(treeEl.getBoundingClientRect().width))); | ||
| } else { | ||
| localStorage.setItem( | ||
| LS_PREVIEW, String(Math.round(previewEl.getBoundingClientRect().width))); | ||
| } | ||
| } | ||
|
|
||
| document.addEventListener("pointermove", onMove); | ||
| document.addEventListener("pointerup", onUp); | ||
| } |
Comment on lines
+82
to
+88
| if (which === "tree") { | ||
| localStorage.setItem( | ||
| LS_TREE, String(Math.round(treeEl.getBoundingClientRect().width))); | ||
| } else { | ||
| localStorage.setItem( | ||
| LS_PREVIEW, String(Math.round(previewEl.getBoundingClientRect().width))); | ||
| } |
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.
No description provided.