Skip to content

web: open a file view over the Agent area instead of shrinking it #170

Closed

Description

@yansfil

Problem

Opening a file or diff while the Workspace is in Agents only switches the layout to Agents and Views, so the View areas take space beside the Agent area and every agent pane shrinks.
The core does this in herdr-core/src/runtime/workspace_view.rs (apply_area_intent_to, AreaIntent::Views turns Agents into Together), and docs/UI_BEHAVIOR.md ("Opening a file from Agents only switches to Agents and Views") and S7 PRD B22 state it as the contract.

Wanted

A file view opened from Agents only draws over the Agent area instead of beside it.

  • The Agent area keeps its full size underneath, so no terminal or PTY resizes when a view opens or closes.
  • The View areas (tabs, splits, preview, dirty state) behave as they do today inside the overlay.
  • The operator can hide the side panel without closing any view and restore its previous content with Command Shift B.
  • Panel content is views or tools only. Closing the last view leaves tools visible when enabled; otherwise the core closes and persists the panel. There is no empty panel body.
  • Command E opens tools from closed, closes a tools-only panel, and toggles the tool column beside views while keeping the selected tool.
  • Command W closes the display or terminal pane that owns the keyboard, never the whole tab. Tools or no keyboard owner close nothing and record a diagnostic. Explicit tab close controls and menus still close tabs.
  • The panel can be closed, open over agents, or expanded; Pin docks it beside agents. Hiding and showing the whole panel preserves its views and tool visibility.
  • Browser displays shown in a View area follow the same overlay rule; their native view must sit inside the overlay bounds and never above a menu or sheet.

Scope notes

This changes an approved contract: update docs/UI_BEHAVIOR.md in the same change.
Overlay visibility is Workspace presentation, so it belongs with the rest of workspace_view state in the core per docs/ARCHITECTURE.md, not in shell-local state.

Activity

  1. added
    enhancement
    on Sep 26, 2026
  2. yansfil commented on Sep 26, 2026

    @yansfil
    ContributorAuthor

    Decisions for the side panel (operator, 2026-09-26)

    The operator rejected the floating inset panel from PR #173 and chose, from design boards drawn in a local Pen scratch, a panel docked to the right that holds the Explorer.
    These decisions are the contract for the implementation that updates PR #173.

    Hierarchy

    • Workspace > Toolbar, Body.
    • Body > Agent area (always the full body width) + Side panel (docked to the right edge, drawn over the agents, left edge resizes).
    • Side panel > one tab strip across the whole panel (View tabs with kind marks, New tab, Pin, Expand, panel toggle), then a row with the active document's header on the left and the Explorer's filter field on the right, then the body: View areas on the left, the tool column (Explorer above History) attached on the right.

    Chosen behavior

    • Over by default, Pin to dock: the panel opens over the agents and never resizes a terminal or PTY. A Pin button in the panel strip docks it side by side so the agents narrow to the panel's left edge; unpinning floats it again. There is no fourth toolbar state. Pin is stored per Workspace with the width.
    • The toolbar's three-way layout switch is removed. The toolbar keeps one panel toggle; Expand lives in the panel strip. Menu and palette commands for closed / open / expanded remain.
    • With no view open and the Explorer shown, the panel is only as wide as the Explorer column, including after the last view closes. The "No file or diff is open" empty state appears only when the Explorer is hidden too.
    • The Explorer and History toggles stay in the toolbar; pressing one while the panel is closed opens the panel with that tool.

    Defaults for the remaining questions (implementation-owned, listed under Review in the PR)

    • In the over state, the pane header's actions and the right part of an agent's input and status lines sit under the panel; Pin is the remedy.
    • A closed panel with views open shows the open-view count as a small badge on the panel toggle.
    • Stacked (up/down) splits keep a tab strip per area; the panel's top row holds the top area's tabs and the panel actions.
    • In a window too narrow for both, the panel takes the whole body as a temporary unsaved state that looks like Expanded; a pinned panel floats while narrow and docks again when the window widens.
    • No new elevation token: the panel's left border and resize edge carry the "over" cue.

    Kept from PR #173

    • No terminal or PTY resize when the panel opens, closes, resizes, or expands while over.
    • The width stored per Workspace in the core (views_over_share).
    • The agents left of the panel stay live: clicking or typing there never dismisses the panel.
  3. yansfil commented on Sep 26, 2026

    @yansfil
    ContributorAuthor

    Panel look and follow-ups (operator, 2026-09-27)

    The operator chose the look from boards drawn in a local Pen scratch.

    Separation: tone + inset card ("S2")

    • The panel sits on --card; the agents stay on --background.
    • An --spacing-sm gap separates the agents from the panel on the left only, with no top gap, so the panel's tab strip lines up with the agents' tab strip.
    • The panel's top-left corner is rounded with --radius-lg. The bottom corner stays square because the panel runs to the window's bottom edge.
    • A --border hairline runs around the card. There is no drop shadow and no new token.
    • When pinned, the gap is the resize grip: dragging anywhere in it resizes the panel, replacing the 2px edge as the target.
    • With no view open, when the card is only as wide as the tool column, New tab, Pin and Hide move onto the EXPLORER title row, so two header rows are not stacked.
    • Beside a document, the EXPLORER title row matches the document header's height.

    Also decided for PR #173

  4. yansfil commented on Sep 26, 2026

    @yansfil
    ContributorAuthor

    Side panel hierarchy, revised (operator, 2026-09-27)

    This supersedes the hierarchy and the tool-toggle points of the two earlier decision comments. The S2 look stays: the --card surface, the left --spacing-sm gap that is the resize grip when pinned, the --radius-lg top-left corner, the --border hairline, and no shadow.

    The operator reviewed the first build and found the same actions in two places. The toolbar's panel toggle and the panel's Hide both close the panel. The toolbar's Explorer toggle and the EXPLORER × both close the Explorer. The "+" on the EXPLORER row reads as "new file". The rule now: every control sits once, on the container it changes.

    Hierarchy

    • The side panel runs the full height of the Workspace, up to the toolbar row. The toolbar (the path) spans only the agent column.
    • Panel row 1 (at the toolbar row's height):
      • View tabs, with one "+" New tab right after each area's tabs.
      • Then the tool-column toggle (pressed while the tools show), Expand ⤢, Pin, and the panel toggle ◫ at the far right.
      • When the panel is closed, ◫ stays in that top-right spot, with the open-view count badge.
    • Panel row 2 (level with the agents' tab strip): the active document's header (path, Wrap, Find) on the left, and icon tabs over the tool column: Files (Explorer) and History, with the active one marked.
      • One tool shows at a time.
      • There is no per-tool title row and no ×.
      • Tooltips and accessible names keep the existing names Explorer and History.
    • The toolbar loses its Explorer and History toggles. ⌘E and ⌘⇧B open the panel on a tool and show the tool column.
    • With no view open, the panel is only the tool column. Row 1 holds the tool icon tabs, Pin, and ◫: the tools-only panel can be pinned beside the agents.
    • Empty (no view, tools hidden): the panel says nothing is open and names ⌘P.
    • Narrow window: the panel covers the body. Expand and Pin are hidden there, and the tools open as the existing temporary overlay.

    Model change this implies
    The core stores one active tool (Files or History) and a tools-shown flag per Workspace, instead of two independent explorer/changes flags.

  5. yansfil commented on Sep 27, 2026

    @yansfil
    ContributorAuthor

    Follow-ups from the review of PR #173 (operator, 2026-09-27)

    • Resize grip. Hovering the panel's left edge shows a vertical hairline with a small centred pill that holds a ⇆ (arrow-left-right) icon, as in the operator's reference; it stays while dragging. This replaces the 2px primary guide. Every panel state that has a width can be resized this way, including the tools-only panel, whether it floats or is pinned; its width is stored like the others.
    • ⌘E opens the Explorer. ⌘E shows the side panel on the Explorer with the tool column visible, and hides the tool column when the Explorer already shows. The sidebar's Agents/Projects switch loses ⌘E as its default chord; it stays a command that can be rebound in Shortcuts.
    • Light tokens. The seven Light tokens raised to AA in c010a8f stay as they are.
  6. added 3 commits that reference this issue on Sep 27, 2026
    b4e3ce5
    8acbcbc
    21b1597
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions