List view metadata columns and drag-to-resize everywhere

- New optional list-view columns: Description, Size (now includes
  directories), Modified, Owner, Created (via statx birth time), Content
  (item/line count or image dimensions), Access (rwx)
- Drag-to-resize: list view column headers, sidebar sections (Bookmarks/
  Devices/Filetree), Preview/Tags split, and the sidebar/preview side
  panels themselves — all commit to Config on release, not per drag frame
- Column resizing mutates existing row cells live instead of rebuilding,
  with metadata cached per (file, mtime) — fixes lag in large folders
- Fix list view background click (rows were full ListTile width with no
  empty space to click); bookmark selected-background now covers the
  triple-dot menu too; batch rename/new-file dialogs pre-select their
  default text instead of just pre-filling it
- Toolbar scrolls instead of clipping when buttons don't fit; toolbar and
  breadcrumbs are independently toggleable
- Add a "Server" bookmark icon

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
sarahandClaude Sonnet 5 committed 2026-09-26 17:22:55 +02:00
1 parent a5f5c5ca79
commit 31b6c554e6
6 files changed
+699 -89

No files matched your search

+36 -5
View File
@@ -11,7 +11,7 @@ from typing import Optional
import flet as ft
from Browser import Browser
from Core import AppName, ApplyAppearance, BuildTheme, BundledFontFamily, EffectiveSettings, LoadConfig
from Core import AppName, ApplyAppearance, BuildTheme, BundledFontFamily, EffectiveSettings, LoadConfig, ResizeHandle
from Sidebar import Sidebar
@@ -75,8 +75,14 @@ def _BuildWindow(Config, StartPath: Path, **BrowserHooks) -> tuple[ft.Row, Brows
"""The normal SaraFem window (sidebar + browser). The file picker is this
same window with a PickerBar under it, so the two always look alike;
BrowserHooks are the picker's Browser hooks (see Picker.py)."""
OuterRow = ft.Row(expand=True, spacing=0)
# STRETCH so the sidebar-width divider (a bare GestureDetector, no
# layout control of its own) gets a real height to be draggable across —
# confirmed here, not assumed; Flet doesn't stretch Row children by
# default. Sidebar/BrowserView already fill full height regardless
# (their own content drives that), so this doesn't change how they look.
OuterRow = ft.Row(expand=True, spacing=0, vertical_alignment=ft.CrossAxisAlignment.STRETCH)
SidebarView: Optional[Sidebar] = None
SidebarDivider: Optional[ft.Control] = None
def OnPathChanged(NewPath: Path) -> None:
if SidebarView is not None:
@@ -86,19 +92,41 @@ def _BuildWindow(Config, StartPath: Path, **BrowserHooks) -> tuple[ft.Row, Brows
if SidebarView is not None:
SidebarView.RefreshBookmarks()
def _BuildSidebarWidthDivider() -> ft.Control:
"""Resizes the sidebar, never BrowserView on its other side — same
"only touch your own side" convention as the preview panel's
divider in Browser.py, and the two are independent."""
def OnDrag(Delta: float) -> None:
# SidebarSide "right" puts the divider on the sidebar's *left*,
# so dragging right (growing the file list) has to shrink the
# sidebar — sign flips relative to the "left" case.
Signed = -Delta if Config.SidebarSide == "right" else Delta
NewWidth = max(120, (SidebarView.width or Config.SidebarWidth) + Signed)
SidebarView.width = NewWidth
SidebarView.update()
def OnDragEnd() -> None:
Config.SidebarWidth = int(SidebarView.width)
Config.Save()
return ResizeHandle("horizontal", None, OnDrag, OnDragEnd)
def BuildOuterLayout() -> list[ft.Control]:
nonlocal SidebarView
nonlocal SidebarView, SidebarDivider
Layout: list[ft.Control] = [BrowserView]
if Config.ShowSidebar and (Config.ShowBookmarks or Config.ShowDevices or Config.ShowFiletree):
SidebarView = Sidebar(
OnNavigate=BrowserView.NavigateTo, Config=Config, OnFilesMoved=BrowserView.Refresh
)
SidebarDivider = _BuildSidebarWidthDivider()
if Config.SidebarSide == "left":
Layout.insert(0, SidebarView)
Layout[0:0] = [SidebarView, SidebarDivider]
else:
Layout.append(SidebarView)
Layout += [SidebarDivider, SidebarView]
else:
SidebarView = None
SidebarDivider = None
return Layout
def OnToggleSidebar() -> None:
@@ -111,6 +139,9 @@ def _BuildWindow(Config, StartPath: Path, **BrowserHooks) -> tuple[ft.Row, Brows
return
SidebarView.visible = Config.ShowSidebar
SidebarView.update()
if SidebarDivider is not None:
SidebarDivider.visible = Config.ShowSidebar
SidebarDivider.update()
if Config.ShowSidebar:
SidebarView.UpdateSelection(BrowserView.CurrentPath)