Skip to content

Results table: file icons, sortable columns, row selection, context menu#73

Open
AlanKK wants to merge 4 commits into
mainfrom
fix/fyne-app-id-and-do-migration
Open

Results table: file icons, sortable columns, row selection, context menu#73
AlanKK wants to merge 4 commits into
mainfrom
fix/fyne-app-id-and-do-migration

Conversation

@AlanKK

@AlanKK AlanKK commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Brings the results table closer to Everything for Windows and a native file manager.

What's new

  • File-type icons per row, from object type and extension.
  • Sortable columns — click a header to sort by name, path, size or modified; click again to reverse.
  • Row selection with keyboard navigation (up/down/enter/escape). Fyne highlights a single cell, so the row band is drawn per-cell.
  • Right-click menu — reveal in the file manager, copy name / full path / containing folder.
  • Double-click reveals the file. handleOpenFile was dead code until now.
  • Main menu with Close Window and About.

Also carries the earlier app ID + fyne.Do migration commit, which never reached main.

Fixes along the way

  • theme.Icon returned the app logo for every icon name, which would have made all file-type icons identical. It now delegates to the default theme — and the app icon is set explicitly, since the menu bar tray was relying on that accident and fell back to a broken-image glyph without it.
  • Selection happens on mouse press, not Tapped. Fyne defers Tapped on a DoubleTappable widget for the system double-click interval, which showed up as visible lag before the row highlighted.
  • Cell updates only repaint what changed; the callback runs for every visible cell on each refresh.
  • Tool tips are cancelled when the context menu opens and when scrolling recycles a cell onto another row. The library shows a tip on its own timer and captures the text when armed, so a stale one either drew under the menu overlay with no layer (no tool tip layer created for current overlay) or showed the wrong file's details.

Merge with #72

#72 landed overlapping work while this branch was open — both solved column resizing and reworked tooltips, differently. Reconciled in de2e5c9:

  • Kept from main: padding 4 / separator 1 grab zone, redesigned GetFileInfo with path wrapping, Name-column overflow fallback.
  • Kept here: icons, sorting, selection, context menu, keyboard nav.
  • The Name column's character budget now subtracts the icon width, or Resizable columns, no-overflow Name cells, and a redesigned tooltip #72's overflow fallback would misjudge where the text ends.
  • Dropped the per-header resize grip — main's separator of 1 already draws the dividers.
  • GetFileSizeMod formats via HumanizeSize instead of repeating the size ladder, so sizes under 1K read as bytes rather than 0.5K.

Testing

make build, make test, go test -race, go vet and gofmt all clean; new unit tests cover icon mapping, sorting, selection, header state and the two tooltip cancellations.

Input-driven behaviour can't be exercised headlessly and needs a human pass: the context menu, double-click reveal, arrow-key navigation, column drag-resize, and the two tooltip repros (hover a row for a full second then right-click; hover then scroll without moving the pointer).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wzp3FVUYuL1ESJGfrimHMM

AlanKK and others added 4 commits July 24, 2026 07:40
The GUI logged two Fyne v2.8.0 diagnostics on every launch:

  Fyne error: Preferences API requires a unique ID, use app.NewWithID()
  *** This application has not been migrated to the fyne.Do threading model ***

app.New() left UniqueID() falling back to a throwaway "missing-id-<unix>"
regenerated per launch, which would silently break the Preferences and
Storage APIs. The migration banner precedes Fyne removing that safety in
the next major release.

Declare both in code via app.SetMetadata + app.NewWithID rather than a
FyneApp.toml: `make app` runs `fyne package -executable`, which wraps the
prebuilt binary and never compiles TOML metadata in, and
checkLocalMetadata bails out under -tags release and looks for the file
next to the executable — inside the .app bundle, where none ships. Using
Migrations{"fyneDo": true} also avoids threading -tags migrated_fynedo
through every build path.

The app was already migrated in practice: every off-main-thread UI
mutation (search goroutine, tooltip hover, tap-to-copy, debounce timer)
goes through fyne.Do, and Fyne dispatches systray menu actions via
runOnMain. Declaring the migration does silence Fyne's wrong-thread
runtime warnings, so AGENTS.md records the contract for future UI code.

Also migrate .github/copilot-instructions.md to AGENTS.md with CLAUDE.md
as a symlink, and fix its stale `ev -b copilot-instructions.md` example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Haq5pxXkyML6TgwEKfss7n
Brings the GUI closer to Everything for Windows and a native file manager.

- File-type icons per row, mapped from extension and object type.
- Click a header to sort by name, path, size or modified; click again to
  reverse. Sorting runs on the UI thread, where the sort state is written.
- Row-level selection with keyboard navigation (up/down/enter/escape).
  Fyne highlights a single cell, so the row band is drawn per-cell.
- Right-click menu: reveal in the file manager, copy name/path/folder.
- Double-click reveals the file. handleOpenFile was dead code until now.
- Main menu with Close Window and About.

theme.Icon returned the app logo for every icon name, which would have made
every file-type icon identical; it now delegates to the default theme.
Padding was 0, which collapsed the table's column dividers -- Fyne only
starts a resize drag inside one -- so columns could not be resized at all.

GetFileSizeMod also returns raw size and mod time so sorting does not need
a second stat per row.

Selection happens on mouse press, not Tapped: Fyne defers Tapped on a
DoubleTappable widget for the system double-click interval, which showed up
as lag before the row highlighted. Cell updates only repaint what changed,
as the callback runs for every visible cell on each refresh.

Tool tips are cancelled when the context menu opens and when scrolling
recycles a cell onto another row -- the library shows a tip on its own timer
and captures the text when armed, so a stale one either drew under the menu
overlay with no layer or showed the wrong file's details.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wzp3FVUYuL1ESJGfrimHMM
The plan has been executed; the code and its tests are the record now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wzp3FVUYuL1ESJGfrimHMM
#72 landed overlapping work on main while this branch was open. Both
solved column resizing and reworked tooltips, differently.

Kept from main: padding 4 / separator 1 for the resize grab zone, the
redesigned GetFileInfo with path wrapping, and the Name-column overflow
fallback. Kept from this branch: file-type icons, sortable headers, row
selection, the context menu and keyboard navigation.

The Name column's character budget now subtracts the icon width, or the
overflow fallback #72 added would misjudge where the text ends.

Dropped the per-header resize grip: main's separator thickness of 1 draws
the dividers, so the grip was a second affordance for the same thing.

GetFileSizeMod now formats via HumanizeSize rather than repeating the
size ladder, so sizes under 1K read as bytes instead of "0.5K".

Set the app icon explicitly. The menu bar tray falls back to the app icon
and then to a broken-image glyph; it only ever showed the logo because
theme.Icon returned it for every icon name, which the file-type icons
required changing.

Tests run under the app theme: the test theme has no bold monospace font,
which the Name cell now measures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wzp3FVUYuL1ESJGfrimHMM
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