Open
Conversation
Introduce TUI sidebar support and centralize quota rendering logic. Adds new TUI runtime, sidebar formatter, config diagnostics, and quota-render-data modules; updates display sanitization and quota-status to include TUI diagnostics. Package.json exports, oc-plugin entries, dependencies, and build script updated to publish TUI assets (prepare-tui-dist). README updated with TUI install instructions and OpenCode version bump. Plugin code refactored to reuse collectQuotaRenderData/provider cache logic (removes duplication). New tests and tui.jsonc added to cover TUI behavior and rendering.
Add a compact, width-safe session tokens renderer and fix TUI sidebar to use a dedicated compact layout. - Introduce renderSessionTokensLines(options) with maxWidth to choose between wide and compact layouts; add renderCompactSessionTokensLines and WIDE_SESSION_TOKEN_LINE_WIDTH. - Pass maxWidth through formatQuotaRows and grouped toast formatter so callers can request compact token output. - Add TUI_SIDEBAR_LAYOUT constant (and export it) and make buildSidebarQuotaPanelLines use that fixed layout instead of reading toast layout from config; clamp sidebar width to a safe, compact renderer. - Update tests to cover the new compact session-token formatting and the sidebar layout behavior. - Update README to note that the TUI sidebar uses its own fixed compact layout and that toast layout settings only affect toasts.
Introduce a shared "Session input/output tokens" heading and sidebar-friendly rendering: export SESSION_TOKEN_SECTION_HEADING, normalize/clamp helpers, and renderSidebarSessionTokenSummaryLines from session-tokens-format (one-line totals for the fixed-width TUI panel). Add tui-line-style helper to preserve normal text color for the heading and mute other lines, and update tui.tsx to use it. Modify tui-sidebar-format to keep per-model token rows out of the main quota formatter and append the compact sidebar summary. Update types/comments and README to document TUI install step, shared settings (toast vs sidebar differences), and the showSessionTokens behavior. Update and add tests to cover rendering, runtime behavior, styling, and config runtime-path mocking.
Replace the boolean `enabled` panel flag with a `SidebarPanelState` (status: "loading" | "disabled" | "ready") and add helpers `shouldRenderSidebarPanel` and `getSidebarPanelLines`. Update runtime and TUI code to use the new state shape and to hide the panel when disabled while providing appropriate loading/unavailable placeholders. Improve line color logic to keep truncated session-heading text highlighted. Add unit and integration tests for panel state, runtime behavior, line styling, and config runtime-path resolution, and update README wording to clarify how the sidebar hides stale/loading quota content when disabled.
# Conflicts: # package-lock.json
c70eb0d to
94ccf46
Compare
Author
|
@slkiser this is now based on your latest commits to main.. |
Owner
|
Hello, sorry I push to main for this project, I'll take a look and implement soon :) |
# Conflicts: # README.md # package-lock.json # src/lib/quota-status.ts
Author
|
@slkiser I've fixed this pr against your force pushed main branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce the Kimi Code provider, enabling authentication through environment variables and configuration files. Implement a quota fetcher with string-number parsing and a fallback mechanism. Add tests for the new provider and ensure alignment of package dependencies. This enhancement expands the functionality of the application by integrating Kimi's services.
Linked Issue
#45
OpenCode Validation
Quality Checklist
npm run typechecknpm testnpm run buildREADME.mdandCONTRIBUTING.mdwhen applicable)