Skip to content

fix(list): autofit columns on resize-handle double-click - #1116

Open
JoeJoeflyn wants to merge 1 commit into
mainfrom
fix/1115-list-column-autofit
Open

JoeJoeflyn wants to merge 1 commit into
mainfrom
fix/1115-list-column-autofit

Conversation

@JoeJoeflyn

@JoeJoeflyn JoeJoeflyn commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Double-clicking a List-view column resize handle was a no-op: register_list_column_cell applies the column's fixed width_request to every registered cell, so measure() inside max_child_natural_width echoed the current width back, and all row/heading labels cap natural width at one character via max_width_chars(1). The autofit could therefore never change the width.

This measures each registered cell with both constraints lifted (list_cell_content_width clears the cell's width_request and descendant labels' max_width_chars, measures, then restores them), so double-click now expands the column to fit its widest content — matching the Miller-columns behavior added in #114. The same code path serves the FileChooser dialog, which is fixed identically.

Also includes a separate style: commit applying rustfmt to files that drifted on main.

Visual evidence

screenrecording-2026-09-18_18-14-31.mp4

Pending — needs owner upload. gh cannot attach images; please drag these into the editor:

  • target/pr-captures/autofit-before.png — Name column manually narrowed, long filename ellipsized
  • target/pr-captures/autofit-after.png — after double-click on the resize handle: column expanded, full filename visible

How to test

  1. Switch to List view (Ctrl+3) in a folder containing a file with a long name
  2. Drag the Name column's resize handle left to narrow it (or leave at default with a long name)
  3. Double-click the resize strip at the right edge of the column header

Expected result: the column expands to fit its widest entry. Works the same in the FileChooser dialog's list view.

Related issue

Closes #1115

Registered cells carry the column's fixed width_request and their labels
cap natural width at one character, so measuring them echoed the current
width back and the autofit could never change anything. Measure each cell
with both constraints lifted instead.
@JoeJoeflyn
JoeJoeflyn force-pushed the fix/1115-list-column-autofit branch from 62efa50 to d4d822a Compare September 18, 2026 11:46
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.

List view: double-click column resize handle does not autofit width

1 participant