Skip to content

feat(files): add repository-aware viewer - #183

Closed
Lint111 wants to merge 2 commits into
Ark0N:masterfrom
Lint111:agent/split-repository-viewer
Closed

feat(files): add repository-aware viewer#183
Lint111 wants to merge 2 commits into
Ark0N:masterfrom
Lint111:agent/split-repository-viewer

Conversation

@Lint111

Copy link
Copy Markdown
Contributor

Summary

Add a repository-aware File Viewer that follows the active Codeman session and remains usable on phones.

The PR is intentionally split into two commits:

  1. feat(files): add authorized repository browsing
    • discovers the repository and linked worktrees from the session path
    • exposes bounded repository overview, commit detail, and file diff routes
    • extends existing file/preview routes with an opaque worktree scope
    • rejects symlink escapes, binary/oversized previews, forged scopes, and worktrees outside the authenticated workspace
  2. feat(files): add repository-aware viewer
    • adds Files, Changes, and History tabs
    • renders compact/full diffs and lazy commit details
    • synchronizes viewer ownership immediately on session changes
    • prevents stale async loads from replacing the newly selected session
    • adds an authenticated local-session work-path editor
    • provides a full-screen phone preview with stable diff gutters

User Experience

  • File Viewer defaults to the active session's current repository/worktree.
  • Switching Codeman sessions immediately resets the viewer to that session's current scope.
  • Sibling worktrees can be selected without sending arbitrary filesystem paths from the browser.
  • Current changes show status, path, staging state, and line counts.
  • Commit history expands lazily and opens committed-file diffs.
  • Diff preview can switch between compact patch and full-file modes.
  • The opt-in File Viewer header action remains available on mobile.
  • A session can reassign its Codeman work-path metadata when a restored agent reports a more accurate repository path.

Work-path reassignment updates Codeman metadata, parsers, watcher roots, and persisted mux state. It intentionally does not change the cwd of an already-running child process.

Security

  • Repository scope ids are resolved only on the server.
  • Every selected root is checked with the authenticated workspace policy.
  • Unauthorized linked worktrees are removed from repository overview responses.
  • File resolution uses real paths and rejects symlink escapes.
  • Diff previews bound text size and do not return binary bodies.
  • Remote and container sessions cannot use local work-path reassignment.

Validation

  • npx vitest run --config config/vitest.config.ts test/git-repository-browser.test.ts test/routes/file-routes-repository.test.ts
    • 8 tests passed
  • npx vitest run --config config/vitest.config.ts test/git-repository-browser.test.ts test/routes/file-routes-repository.test.ts test/routes/session-routes.test.ts test/tmux-manager.test.ts
    • 139 tests passed
  • npx vitest run --config test/mobile/vitest.config.ts test/mobile/file-viewer.test.ts
    • 5 Playwright-backed tests passed
  • npm run check:frontend-syntax
    • 26 frontend files passed
  • npm run build
    • passed

Scope

This PR does not include terminal input, mobile navigation controls, viewport sizing, terminal-history streaming, response-viewer behavior, hook lifecycle, notifications, shutdown, case actions, or animation settings. Those are being reviewed as independent feature PRs.

Expose repository status, commit history, and bounded diff details for the active session worktree. Resolve opaque worktree scopes server-side and reject or filter paths outside the authenticated workspace.
Add Files, Changes, and History views with compact or full diffs, worktree selection, and active-session synchronization. Support authenticated local work-path reassignment and a full-screen mobile diff experience.
@Lint111
Lint111 marked this pull request as ready for review July 29, 2026 17:58
CopilotAI review requested due to automatic review settings July 29, 2026 17:58

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ark0N

Ark0N commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Hi Lior, closing this one as part of a cleanup of the seventeen PRs currently open from you. The full explanation is in #173, and I would rather you read that one than this note, because it is the honest version and it is not a dismissal of your work.

The short form: sixteen PRs opened in a single day, roughly 42,000 added lines in total, landing mostly on the same few files (nine touch app.js, eight touch terminal-ui.js), with five already conflicting against master and none carrying CI results. I cannot review that at the standard this codebase needs, and merging it at a lower standard would be worse than not merging it.

Going forward, please keep no more than three open PRs at a time, each one a single behavior change that stands on its own, with a test that fails on master and passes with the fix. #214 and #215, merged today, are good models.

If this particular change fixes something that genuinely annoys you in daily use, it is a good candidate to be the first one you reopen on its own, rebased on current master. I will review it properly.

Thanks for the effort you put in, and sorry to close it this way.

@Ark0NArk0N closed this Aug 5, 2026
Sign up for freeto 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.

3 participants

@Lint111@Ark0N