Skip to content

Drag the lines between panes, and pick their widths with W - #114

Open
rustytensor wants to merge 1 commit into
omacom:mainfrom
rustytensor:upstream-pane-widths
Open

rustytensor wants to merge 1 commit into
omacom:mainfrom
rustytensor:upstream-pane-widths

Conversation

@rustytensor

Copy link
Copy Markdown

The lines between the sidebar, the files, the details and a split's two halves can now be dragged, and W picks how wide the panes are when they haven't been dragged. Until you drag a line or press W, every pane is exactly as wide as it is today.

Why

Folio's panes have fixed widths: 190 px for the sidebar, 260 for each column, 300 for the details. On a laptop that's a lot of the window for the sidebar and the details. On a wide screen, the columns cut off long names while there's room to spare. And a split is always half and half, even when one side needs more room than the other.

Dragging a line fixes the pane you're looking at. W is for when you want all of them to follow a rule instead of sizing each one by hand.

What you'd notice

  • Every line between panes can be dragged: the sidebar's, the details', the line between a split's halves, and the line after any column, which sizes all the columns together. The pointer turns into the resize cursor over a line. The window looks the same as before, since the lines get no new handles or colors.
  • A dragged width stays when you resize the window and when you restart Folio. Double-clicking a line puts that pane back to its normal width.
  • Each pane has limits, so dragging can't hide one or let it take over the window: the sidebar goes from 140 to 400 px, the details from 220 to 600, the columns from 180 to 480, and each half of a split keeps at least 360.
  • W and Shift+W step through three ways of sizing the panes, and the banner names the one you landed on:
    • Fixed: the widths Folio has today. This is the default.
    • Automatic: the sidebar and the columns fit their widest row, so a long name shows whole. The details stay at 300.
    • Proportional: each pane keeps the share of the window it has at 1280 px, so on a 2560 px screen the sidebar is 380 and the details 600.
  • Pressing W lets go of every dragged width, so the way you picked applies to all the panes.
  • Right to left, the sidebar and the details swap sides and each line drags the other way, so a pane still grows when you drag its line away from it.
  • A line reaches a few pixels over the pane beside it, where that pane's scroll bar is. When the scroll bar is showing, a press there goes to the scroll bar, not the line.

Keys

Key Does
W, Shift+W Pane widths: fixed, automatic, proportional
Drag a line Size the pane beside it
Double-click a line Put that pane back

W and the double-click are in the README and the ? overlay. The new strings are only in en.json.

What changed

  • A new PaneWidths class does the sums: the way picked, the window's width, the dragged widths and each pane's limits. It's kept apart from the window so it can be tested without one. Each window has its own, and Main.qml keeps the way and the dragged widths in its Settings.
  • A new PaneDivider.qml is the grip on each line. It has no look of its own. A press only counts as a drag once the pointer moves across by the system's drag distance, so a click or a press that wobbles up and down leaves the pane alone.
  • Main.qml puts a grip on the sidebar's line, the split's line and the details' edge, and gives the sidebar, the details and a dragged split their widths from PaneWidths.
  • FolderColumns puts a grip on the line after each column, and in automatic mode measures the widest name across the columns on screen. It measures with the font and margins of the rows it really draws, which FileRow now exposes, so the measured width matches what's drawn. Sidebar says how wide its widest row is.
  • FolderPane adds W and Shift+W.
  • Windows takes the folder Main.qml is read from (the app's resources by default), so a test can open Folio's own window from the source folder.

Tested

On Fedora 45 in a clean build root, built with the project's -Wall -Wextra: no warnings, on a clean rebuild.

folio_tests: 195 passed, 12 skipped, 2 failed. Main passes 182 on the same root, and the 13 new tests below all pass. The two failures are the same ones main has there (kindsFromMimeTypes, previewerPicksAViewerForEachType, Fedora's MIME type for shell scripts).

  • paneWidthsStartFixed: with nothing picked, the widths are today's 190, 300 and 260, and a split is even.
  • paneWidthsFollowTheWindow: the proportional widths at 2560, 960 and 640 px, including where the limits stop them.
  • paneWidthsFitTheirContent: the automatic column width for short, medium and 300-character names, and the sidebar fitted to a pinned folder with a very long label.
  • paneWidthsKeepWhatYouDrag, paneWidthsDragInAnyMode: real drags on each line in a window that uses Main.qml's own Settings. Each test checks the width reached, the limits, that a double-click puts the pane back, that a dragged width stays while the window is resized and the others follow it, and that a new window finds the same widths.
  • paneWidthsKeyStepsThroughModes: W and Shift+W go round in both directions, the banner says which way is on, and a dragged width is let go.
  • splitWindowSharesItsRoom, splitDividerMovesFromWhereTheHalvesAre: in Folio's real window, the halves, the sidebar, the details and the lines add up to the window's width exactly. A half held at its 360 px minimum moves as soon as you drag it, without a dead zone first.
  • dividersTurnRoundRightToLeft: right to left, each line drags its pane the right way, and a column's line can be grabbed on either side.
  • automaticColumnsFitTheRowsTheyDraw: a long name fits its column with nothing cut off, measured from the row on screen.
  • automaticColumnsOpenALargeFolderWithoutFreezing: fitting the columns while 20,000 names load never holds the window up for 250 ms or more.
  • dividerPressWithoutADragKeepsTheWay: a press that doesn't move across leaves the pane following its way.
  • scrollBarsKeepTheirPresses: in the list and the columns, left to right and right to left, dragging a scroll bar next to a line scrolls the files and resizes nothing.

I also broke the right-to-left handling in PaneDivider.qml on purpose and ran the same check, and dividersTurnRoundRightToLeft failed as it should.

This doesn't depend on the tree view PR, and either can go in first. They edit neighbouring lines in the same files, and both add the same test helper for opening Folio's real window, so whichever lands second will need a rebase. I'll do that rebase.

The sidebar, the details, the columns and a split's two halves can be
sized by dragging the line beside them. A dragged width is kept between
launches until that line is double-clicked or W is pressed.

W and Shift+W step through three ways of sizing the panes otherwise:
fixed, the widths Folio has always had and still the default; automatic,
where the sidebar and the columns fit their widest row; and proportional,
where each pane keeps its share of a 1280 px window. A notice names the
way picked.

The sums live in PaneWidths, apart from the window, so they can be
checked without one. Windows can now be given the folder Main.qml is
read from, so the tests can open the real window from the source folder.
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect pane sizing in Folio's main file window.

Reserve space for the files before merging; allowed dragged widths can otherwise consume the whole window.

Findings

  1. P1 Files lose their space ▶
  2. P2 Resizing loses your place ▶

Summary

Adds draggable pane dividers and three width modes, with saved settings and new tests.

  • W switches between fixed and window-scaled pane widths.
  • Automatic sizing fits the sidebar and columns to their rows.
  • Dragging a pane divider sets its width until it is reset.

Reviews (1) · Last reviewed commit: "Drag the lines between panes, and pick t..." · Reviewed by Greptile

Comment thread src/Main.qml
visible: win.previewVisible && win.detailsFit
Layout.topMargin: parent.parent.barHeight
Layout.preferredWidth: 300
Layout.preferredWidth: paneSizing.details

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Files lose their space

At a 1000 px window width, dragging the sidebar to 400 px and the details to 600 px leaves no room for the files. Both widths are allowed, but detailsFit still shows the details because it checks only the window width. leftPane has no minimum width to protect it. These widths are saved, so reopening the window can preserve the unusable layout.

Reserve room for the files when applying widths, or hide the details when the requested panes no longer fit.

Comment thread src/FolderColumns.qml
Comment on lines +91 to +97
PaneDivider {
id: grip
objectName: "columnDivider"
anchors.horizontalCenter: parent.horizontalCenter
height: parent.height
pane: "column"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Resizing loses your place

Dragging a column divider changes columnWidth, which changes row.width and fires onContentWidthChanged. That calls revealEnd() on every drag step. If the user has scrolled back to an earlier column, the first resize jumps the view to the last column and moves the grabbed line away from the pointer.

Keep the scroll position or the grabbed line in place while resizing; reveal the end only when navigation adds columns.

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