Skip to content

File tree inside the editor dock instead of a rail (upstream 2bd69011) #437

Description

@evilchinesefood

Part of #417 (upstream main after v0.11.0). Upstream commit 2bd69011 feat(files): integrate the file tree into the editor dock (16 files, +331/-245). Decision needed: the fork's Files rail (#191) and upstream's files_sidebar diverged completely, so none of upstream's files_sidebar/* hunks apply; this is a rebuild of the fork's rail as an in-dock panel, best done together with #430.

What upstream did

  • The standalone right-rail Files sidebar is removed. The tree renders inside the dock, right of the editor, under a shared 40 px breadcrumb toolbar, 250 px wide (shrinks to keep 200 px for the editor). Toggled by a folder button in the file header (icons/folders.svg) or the same secondary-alt-f chord. Shown only while a File / PendingFile tab is active; Changes and Terminal tabs take the full width. Toggling with no file tab open opens a file-picker tab (and the dock, if closed); closing the last file tab auto-closes the tree. The Sessions rail and the tree may now coexist. Panel chrome loses its title row, × button and material background; filter pill and rows restyled.
  • New diff_dock/file_chrome.rs (project_name, render_tree_toggle, render_file_breadcrumbs); render_diff_file_header takes root + a tree_toggle element (36 → 40 px); new diff_file_tab_active(); focus_diff_tab / request_close_diff_tab become pub and take window; FilesEvent::Close(AnyWindowHandle); FILES_SIDEBAR_WIDTH 300 → 250; main.rs −40 lines (the rail mount and its width / opacity / corner-mask locals); wrap_cli_diff_dock(window) passes files_width in. Open state stays per tab (Tab::files_sidebar_open via sync_files_sidebar_session, which now also calls sync_diff_dock_session). Tests adjusted, none new.

What the fork has

  • Per-tab rail, PRESENT and fork-shaped: right-rail sibling of the sessions rail, mutually exclusive (main.rs:2533-2549, sessions_sidebar.rs:81); workspace/tab.rs:59 files_sidebar_open, mirror at main.rs:1445-1450, test files_sidebar_open_is_scoped_to_the_tab_that_opened_it (workspace/mod.rs:796); chord keybindings/defaults.rs:374 secondary-alt-f; CLI-cockpit-only via files_rail_host_visible (files_sidebar/mod.rs:76); every row incl. .md opens as source in the dock (mod.rs:380 open_diff_file_tab); no drag to a pane; fork-only filter.rs, watch.rs (notify watcher stays warm on unmount), context_menu.rs.
  • No file_chrome.rs, no folders.svg; render.rs:411 header still takes icon, no toggle.
  • The fork's dock width is already min(stored, main-panel remainder) and unmounted below the 360 px + one-pane floor (feat: #184 Phase 4 - diff dock per tab, width clamped to the live remainder #193, 7c15bdaa, 7799e2b4); a 250 px in-dock tree eats into that, so the floor rule in CLAUDE.md needs re-deriving (360 + 250 + 200 minimum editor?).

Decision to take

Rail or in-dock? In-dock gives one toolbar, breadcrumbs and a tree that is visible only when a file tab is, and removes the sessions/files exclusion. The fork's rail is what the per-tab model, CLI-cockpit gating and #191 docs describe. If in-dock: build it on #430's panel (upstream edits that commit's panel.rs, view.rs, row.rs) and preserve every fork rule above. If rail: close, and take only diff_file_tab_active() and the breadcrumb toolbar if wanted.

Port (if in-dock)

git show 2bd69011
git show 2bd69011:src-app/src/app/diff_dock/file_chrome.rs

Portable near-verbatim: file_chrome.rs, folders.svg (git add -f), diff_file_tab_active(), the focus_diff_tab / request_close_diff_tab window threading, auto-close in close_diff_tab, the dock body split, the main.rs rail removal. Must be rewritten: the rail → dock render path (render_files_sidebar(width) vs the fork's (window, cx)), the FilesEvent::Close refocus (fork has no FilesEvent; use keyboard.rs's escape path), the sessions/files exclusion at sessions_sidebar.rs:81, and the width clamp.

Done when

  • Cmd+Alt+F with a file tab active shows the tree inside the dock at 250 px, editor keeps ≥ 200 px; switching to the Changes tab hides it; closing the last file tab closes it; it stays scoped to the sidebar tab that opened it; .md rows still open as source; the rail is gone from main.rs.
  • feat: #184 Phase 4 - files sidebar per tab, markdown drag-to-pane dropped #191 tests re-targeted and green; CLAUDE.md floor rule and docs/user/ updated; six gates green.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked-human-reviewNeeds a human to reviewenhancementNew feature or requestupstream-post-v0.11.0Port of upstream arthjean/paneflow main after v0.11.0 (unreleased, surveyed 2026-09-05 at fbfefd25)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions