Skip to content

File Explorer and Git Diff viewer (opt-in) #47

Description

@setkyar

Problem / motivation

pi-web sessions show the conversation, but there is no way to browse the project's file tree or view git diffs from within the web UI. Users who want to see what files were changed or explore the project structure must switch to a terminal or IDE.

Proposed solution

Add an opt-in File Explorer and Git Diff viewer, gated behind user settings so they must be manually enabled.

File Explorer:

  • A collapsible tree view in the sidebar (or as a new right-side panel) showing the session's working directory structure.
  • Folders expand/collapse with arrow keys and click.
  • Clicking a file opens its contents in a read-only viewer pane (or inline).
  • Files modified in the conversation (shown in tool outputs) are highlighted.
  • Respects .gitignore by default (toggleable).

Git Diff viewer:

  • A "Changes" tab or section showing uncommitted and staged changes.
  • Side-by-side or unified diff view with syntax highlighting.
  • Per-file expand/collapse to see diffs.
  • Status bar showing changed/added/deleted file counts.
  • Clicking a changed file shows the full diff inline.

Opt-in mechanism:

  • New settings: pi-web:v1:explorer:enabled, pi-web:v1:git-diff:enabled (both default false).
  • When enabled, the file tree and/or git diff panels appear in the session page.

Backend:

  • GET /api/sessions/:id/files?path=... — list directory / read file contents.
  • GET /api/sessions/:id/git/statusgit status --porcelain.
  • GET /api/sessions/:id/git/diff?file=...git diff / git diff --cached.

Scope:

  • Frontend: New components in web/src/session/ for tree renderer, diff viewer.
  • Backend: New file and git API endpoints in internal/server/.
  • Extends the sidebar/sheet infrastructure already in place.

PR requirements:

  • E2E tests and screenshots showing the file explorer tree, file contents viewer, and git diff panel.
  • Both features must stay hidden when their settings are disabled.

Alternatives considered

  • Could embed a full VS Code-style editor, but that is overkill. Read-only exploration + diffs covers the 80% use case.

Acknowledgement

  • I understand the maintainer triages requests and will invite a PR only if this moves forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions