Skip to content

feat: cross-project usage browser command with multi-panel navigation #67

Description

@jonasotoaguilar

Affected Area

Frontend / UI

Problem Statement

TokenMeter currently renders usage only for the active project/session in the current OpenCode directory. There is no in-TUI way to inspect lifetime usage across other known projects and their historical sessions without manually opening OpenCode in each project directory.

Users working across multiple projects need a read-only browser to answer: which projects have the most lifetime spend, which sessions within a project are heaviest, and how provider/model breakdown looks per project/session.

Proposed Solution

Add a native plugin command and palette entry (registered via the supported keymap palette command mechanism, namespace: "palette" / category: "TokenMeter") that opens a cross-project usage browser.

Navigation (multi-panel):

  • Projects → list all known projects with lifetime totals.
  • Project detail → selected project's aggregate and its session list.
  • Sessions → all sessions for that project.
  • Session detail → single session's totals and provider/model breakdown.

Data shown per row (read-only): lifetime token and cost totals, active period, last activity (updatedAt/createdAt semantics), and provider/model breakdown where available. All totals reuse the canonical input + output + reasoning + cache.read + cache.write spend model already used for Project/Session (context).

Ordering and pinning: the currently open project/session (if in the known set) is pinned first and visually separated; remaining entries are sorted by recent activity descending.

Scope constraints:

  • Read-only: no data editing/deletion, no budgets, no session mutation.
  • Reuses the existing Project aggregation (live session.list + persisted deleted-session aggregate) and session store; introduces no second representation of usage truth.
  • UI inspiration may reference multi-panel navigation patterns, but the implementation must remain terminal-compatible and must not depend on Nerd Fonts. Do not embed any private local paths or usernames in the UI or docs.

Alternatives Considered

  • Open each project directory manually: requires switching directories and loses cross-project comparison.
  • Extend the sidebar to show all projects inline: would crowd the existing Project/Session/Subagents hierarchy and exceed the sidebar's width/height budget.
  • Single flat list of sessions: hides the project-level aggregate that users need first.

Additional Context

Follow the existing palette command seam (api.keymap.registerLayer → api.ui.dialog.replace / DialogSelect) used by TokenMeter: Settings and the sidebar width/height conventions. Source of truth for totals must remain the existing aggregation paths; the browser is presentation only.

Systemic bucket: D — feature request.

Duplicate check: searched open/closed issues for browser, cross-project, progressive disclosure, command, settings — no existing issue owns the cross-project browser or multi-panel navigation (closest is #20 progressive disclosure, which is sidebar-only and closed).

Privacy note: examples use <project-name> placeholders; no absolute paths, usernames, or session payloads are embedded.

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

    enhancementNew feature or requeststatus:approvedIssue approved for implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions