[PR #5579] [MERGED] feat: show context usage across chat modes #6833

Closed
opened 2026-10-23 04:14:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5579
Author: @Gunterlie
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/27/2026
Merged by: @Gunterlie

Base: staging ← Head: feat/context-usage-bar-5577


📝 Commits (8)

  • d3c4a97 feat: show context usage across chats
  • cd87709 fix: address context usage review findings
  • e74dc44 fix: keep context usage in connection menus
  • 8ad4450 fix: align context gauges across chat modes
  • 73276e4 fix: show game context usage in chat settings
  • 98df635 chore: format context usage changes
  • 4ec76df Merge remote-tracking branch 'origin/staging' into running-on-empty
  • 0b24fe0 fix: harden context budget connection lookup and menu positioning

📊 Changes

14 files changed (+351 additions, -59 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/chat/ChatInput.tsx (+13 -2)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+17 -0)
➕ packages/client/src/components/chat/ContextBudgetIndicator.tsx (+76 -0)
📝 packages/client/src/components/chat/ConversationInput.tsx (+13 -2)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+23 -47)
📝 packages/client/src/components/chat/QuickConnectionSwitcher.tsx (+20 -3)
📝 packages/client/src/components/chat/QuickSwitcherMobile.tsx (+12 -2)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+9 -0)
📝 packages/client/src/features/chat-settings/sections/ConnectionSection.tsx (+11 -1)
📝 packages/client/src/lib/professor-mari-context-budget.ts (+20 -2)
📝 packages/client/src/localization/locales/en.json (+5 -0)
📝 packages/client/src/stores/ui.store.ts (+6 -0)
📝 scripts/regressions/open-issues.regression.ts (+125 -0)

📄 Description

Linked issue

Closes #5577

Why this change

  • Users need a compact, always-available indication of measured context usage so they can spot chats approaching their selected model's context limit without adding another permanent bar above the composer.

What changed

  • Add a default-on Advanced setting for context usage.
  • Show a 30px usage gauge around Roleplay, Conversation, and Professor Mari connection controls, with the detailed bar inside their connection popup.
  • Show Game mode usage in Chat Settings > Connection below the GM & Party Model selector.
  • Resolve budgets from the selected connection, local-sidecar runtime size, and the newest assistant usage metadata; hide unknown, random, missing, and unmeasured cases.
  • Add focused regression coverage and update the Unreleased changelog entry and canonical English localization.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Local CodeRabbit reviewed the latest changes with zero findings.
  • pnpm regression:node -- --filter open-issues passed locally.
  • pnpm check passed locally, including localization, formatting, lint, strict TypeScript, and the production build.
  • git diff --check passed.
  • Browser validation remains a manual proof item.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG.md is updated. No files under docs/ or version-bearing files changed.

UI evidence (if applicable)

  • Before/after screenshots or a recording still need to be captured during manual browser verification.

Proof

  • Selected, missing, null, random, local-sidecar, JSON-encoded metadata, and newest-assistant budget behavior have focused regression assertions.
  • Composer-level usage bars are prohibited by regression assertions; Roleplay and Conversation retain popup-only meters, while Game uses its existing Connection settings section.

Summary by CodeRabbit

  • New Features

    • Added context-usage indicators to chat connection switchers, including desktop and mobile views.
    • Added context-budget details to game chat settings and Professor Mari connection menus.
    • Added an Advanced Settings option to show or hide context usage, enabled by default.
    • Added localized labels, values, and accessibility text for context usage.
  • Bug Fixes

    • Improved context-budget calculations for selected connections, local chats, and recent message usage.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5579 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/27/2026 **Status:** ✅ Merged **Merged:** 8/27/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `feat/context-usage-bar-5577` --- ### 📝 Commits (8) - [`d3c4a97`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d3c4a976246bb2e9c9643ae34092fe4bdadbc55e) feat: show context usage across chats - [`cd87709`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd87709e78851be25b03b3391635d77085e3979c) fix: address context usage review findings - [`e74dc44`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e74dc44a4711f175b13145f4e0b3735229bb4c92) fix: keep context usage in connection menus - [`8ad4450`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ad4450c30bb8cf8b4bccf0096e4b583a464b0fc) fix: align context gauges across chat modes - [`73276e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73276e46e5d65f3a787bd2a1038d0b15df0760c8) fix: show game context usage in chat settings - [`98df635`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98df635e3cf3dc97f497f50cb7092cdbfc67a981) chore: format context usage changes - [`4ec76df`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4ec76dfb8bb9aa0b03f450cd1e97f4db2f4c6cfe) Merge remote-tracking branch 'origin/staging' into running-on-empty - [`0b24fe0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b24fe02579e807b2c30c60589af8c8ebbaa19fe) fix: harden context budget connection lookup and menu positioning ### 📊 Changes **14 files changed** (+351 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+13 -2) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+17 -0) ➕ `packages/client/src/components/chat/ContextBudgetIndicator.tsx` (+76 -0) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+13 -2) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+23 -47) 📝 `packages/client/src/components/chat/QuickConnectionSwitcher.tsx` (+20 -3) 📝 `packages/client/src/components/chat/QuickSwitcherMobile.tsx` (+12 -2) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+9 -0) 📝 `packages/client/src/features/chat-settings/sections/ConnectionSection.tsx` (+11 -1) 📝 `packages/client/src/lib/professor-mari-context-budget.ts` (+20 -2) 📝 `packages/client/src/localization/locales/en.json` (+5 -0) 📝 `packages/client/src/stores/ui.store.ts` (+6 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+125 -0) </details> ### 📄 Description ## Linked issue Closes #5577 ## Why this change - Users need a compact, always-available indication of measured context usage so they can spot chats approaching their selected model's context limit without adding another permanent bar above the composer. ## What changed - Add a default-on Advanced setting for context usage. - Show a 30px usage gauge around Roleplay, Conversation, and Professor Mari connection controls, with the detailed bar inside their connection popup. - Show Game mode usage in Chat Settings > Connection below the GM & Party Model selector. - Resolve budgets from the selected connection, local-sidecar runtime size, and the newest assistant usage metadata; hide unknown, random, missing, and unmeasured cases. - Add focused regression coverage and update the Unreleased changelog entry and canonical English localization. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Local CodeRabbit reviewed the latest changes with zero findings. - `pnpm regression:node -- --filter open-issues` passed locally. - `pnpm check` passed locally, including localization, formatting, lint, strict TypeScript, and the production build. - `git diff --check` passed. - Browser validation remains a manual proof item. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `CHANGELOG.md` is updated. No files under `docs/` or version-bearing files changed. ## UI evidence (if applicable) - Before/after screenshots or a recording still need to be captured during manual browser verification. ## Proof - Selected, missing, null, random, local-sidecar, JSON-encoded metadata, and newest-assistant budget behavior have focused regression assertions. - Composer-level usage bars are prohibited by regression assertions; Roleplay and Conversation retain popup-only meters, while Game uses its existing Connection settings section. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added context-usage indicators to chat connection switchers, including desktop and mobile views. * Added context-budget details to game chat settings and Professor Mari connection menus. * Added an Advanced Settings option to show or hide context usage, enabled by default. * Added localized labels, values, and accessibility text for context usage. * **Bug Fixes** * Improved context-budget calculations for selected connections, local chats, and recent message usage. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6833
No description provided.