[PR #7109] [MERGED] feat(connections): gate subscription pills on the usage toggle and show them in the model picker #7479

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7109
Author: @ylli-selmani
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/nanogpt-model-pills-followups


📝 Commits (4)

  • 9e5781c feat(connections): gate subscription pills on the usage toggle and show them in the model picker
  • cf0e1fa docs(changelog): describe pill visibility by the switch rather than by user type
  • 0132444 style(connections): draw the subscription pills as accent tag chips
  • 3ca93f8 Merge branch 'staging' into feat/nanogpt-model-pills-followups

📊 Changes

4 files changed (+112 additions, -33 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+2 -31)
📝 packages/client/src/components/connections/ConnectionModelPicker.tsx (+23 -2)
➕ packages/client/src/components/connections/SubscriptionCostPill.tsx (+85 -0)

📄 Description

Linked issue

Closes #7108

Why this change

The NanoGPT subscription cost pills added in #6686 had two gaps.

A pay-as-you-go user saw subscription pills they never asked for. In the
connection editor, every model drew its cost pill (1x, 2x, Paid) regardless
of the connection's Show subscription usage switch. That switch is off by
default, and it is the user's own statement of whether they want subscription
information for that connection. Someone who never enabled it, and who has no
subscription allowance to compare against, still got a column of subscription
cost markers.

The pills were missing where models are now picked most often. #7102 moved
model selection into the Connections menu by the chat input, sharing one
picker across the desktop menu, the phone menu and Chat Settings. That picker
showed each model's name, ID, context and output limits, but not its subscription
cost, so the place a user now compares models was the one place the cost was
missing. The editor still had them, which left the two surfaces inconsistent.

What changed

  • The usage multiplier pills now follow the connection's Show subscription usage switch, in
    both the connection editor and the model picker. Off means no pills anywhere;
    on means the same pills everywhere.
  • The model picker renders the pills, covering all three of its call sites at
    once with no per-surface work.
  • The pill markup moved into a shared SubscriptionCostPill component so both
    surfaces draw it identically instead of duplicating the classes and hints.

Design decisions worth reviewing

  • No new request and no new state. The multiplier and included flag already
    arrive from the existing detailed=true models call, so the picker shows cost
    with no extra fetch.
  • The gate is the existing switch, not a new setting. It already means "show
    subscription information on this connection", so a second condition would give
    two ways to say the same thing and could disagree.
  • Gating on a saved management token was rejected. The multiplier comes from
    the models call, not the usage endpoint, so a token is not what makes the data
    available; gating on it would hide data the app already has.
  • The gate reads the stored flag through isConnectionFlagTrue. Connection
    flags are persisted as "true"/"false" strings, so a strict boolean check
    would always be false and silently hide the pills. (This is the same trap that
    hid the usage meter in #6686.)
  • A hidden pill is hidden entirely. With the switch off, an included model
    shows nothing rather than a muted pill, which is the simpler reading of "off".

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

  • Manually verify the pills appear in the Connections menu model list when
    the connection's Show subscription usage switch is on
  • Manually verify the pills disappear from the same list when the switch is off
  • Manually verify the pills appear in the connection editor with the switch on
  • Manually verify the pills disappear from the connection editor with the switch off
  • Manually verify 1x, a boosted multiplier and Paid all render correctly
  • Manually verify a non-NanoGPT connection shows no pills in either surface
  • Manually verify light and dark themes
  • Manually verify the model list layout is unchanged apart from the pills

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)

Notes for the reviewer

  • The gating change is a behavior change to something already shipped in
    #6686: pills that were always visible in the editor are now off by default,
    because the switch they follow is off by default. That is the intent of #7108,
    but it is worth knowing this makes previously-visible information opt-in.
  • No new localization keys. The pill labels and hints already exist from #6686 and
    are reused unchanged.
  • ConnectionModelPicker is shared by three call sites, so the picker change
    covers the desktop menu, the phone menu and Chat Settings in one place.

UI evidence (if applicable)

Quick Connections Panel, before

before

Quick Connections Panel, switch on

show usage pills in quick connection panel when toggle is on

Quick Connections Panel, switch off

hide usage pills in quick connection panel when toggle is off

Different Provider, no pills and no usage

nothing on a different provider

All different pills in view

all different pills in view

Mobile View:

mobile view of pills in new connection switcher

Summary by CodeRabbit

  • New Features
    • Model options in the connection editor and model picker display subscription-cost labels when Show subscription usage is enabled. This setting is off by default.
    • Included models show 1x or a higher multiplier based on weekly allowance usage per token; balance-billed models show Paid.
    • Labels are hidden when the setting is off or for pay-as-you-go users.

🔄 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/7109 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/nanogpt-model-pills-followups` --- ### 📝 Commits (4) - [`9e5781c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e5781c9037ebdf74cf1036271421dcf063c2ea3) feat(connections): gate subscription pills on the usage toggle and show them in the model picker - [`cf0e1fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf0e1fa68e95f511add53285c80970dfc5164050) docs(changelog): describe pill visibility by the switch rather than by user type - [`0132444`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0132444de0dd96a646c522cf49bf143692adc11e) style(connections): draw the subscription pills as accent tag chips - [`3ca93f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3ca93f86169aaf444b34dceba02bd53498b71568) Merge branch 'staging' into feat/nanogpt-model-pills-followups ### 📊 Changes **4 files changed** (+112 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+2 -31) 📝 `packages/client/src/components/connections/ConnectionModelPicker.tsx` (+23 -2) ➕ `packages/client/src/components/connections/SubscriptionCostPill.tsx` (+85 -0) </details> ### 📄 Description ## Linked issue Closes #7108 ## Why this change The NanoGPT subscription cost pills added in #6686 had two gaps. **A pay-as-you-go user saw subscription pills they never asked for.** In the connection editor, every model drew its cost pill (`1x`, `2x`, `Paid`) regardless of the connection's **Show subscription usage** switch. That switch is off by default, and it is the user's own statement of whether they want subscription information for that connection. Someone who never enabled it, and who has no subscription allowance to compare against, still got a column of subscription cost markers. **The pills were missing where models are now picked most often.** #7102 moved model selection into the **Connections** menu by the chat input, sharing one picker across the desktop menu, the phone menu and Chat Settings. That picker showed each model's name, ID, context and output limits, but not its subscription cost, so the place a user now compares models was the one place the cost was missing. The editor still had them, which left the two surfaces inconsistent. ## What changed - **The usage multiplier pills now follow the connection's Show subscription usage switch**, in both the connection editor and the model picker. Off means no pills anywhere; on means the same pills everywhere. - **The model picker renders the pills**, covering all three of its call sites at once with no per-surface work. - **The pill markup moved into a shared `SubscriptionCostPill` component** so both surfaces draw it identically instead of duplicating the classes and hints. ## Design decisions worth reviewing - **No new request and no new state.** The multiplier and `included` flag already arrive from the existing `detailed=true` models call, so the picker shows cost with no extra fetch. - **The gate is the existing switch, not a new setting.** It already means "show subscription information on this connection", so a second condition would give two ways to say the same thing and could disagree. - **Gating on a saved management token was rejected.** The multiplier comes from the models call, not the usage endpoint, so a token is not what makes the data available; gating on it would hide data the app already has. - **The gate reads the stored flag through `isConnectionFlagTrue`.** Connection flags are persisted as `"true"`/`"false"` strings, so a strict boolean check would always be false and silently hide the pills. (This is the same trap that hid the usage meter in #6686.) - **A hidden pill is hidden entirely.** With the switch off, an included model shows nothing rather than a muted pill, which is the simpler reading of "off". ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - [x] Manually verify the pills appear in the **Connections** menu model list when the connection's **Show subscription usage** switch is on - [x] Manually verify the pills disappear from the same list when the switch is off - [x] Manually verify the pills appear in the connection editor with the switch on - [x] Manually verify the pills disappear from the connection editor with the switch off - [x] Manually verify `1x`, a boosted multiplier and **Paid** all render correctly - [x] Manually verify a non-NanoGPT connection shows no pills in either surface - [ ] Manually verify light and dark themes - [x] Manually verify the model list layout is unchanged apart from the pills ## Docs and release impact - [ ] No docs changes needed - [x] 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) ## Notes for the reviewer - The gating change is a **behavior change** to something already shipped in #6686: pills that were always visible in the editor are now off by default, because the switch they follow is off by default. That is the intent of #7108, but it is worth knowing this makes previously-visible information opt-in. - No new localization keys. The pill labels and hints already exist from #6686 and are reused unchanged. - `ConnectionModelPicker` is shared by three call sites, so the picker change covers the desktop menu, the phone menu and Chat Settings in one place. ## UI evidence (if applicable) ### Quick Connections Panel, before <img width="1295" height="757" alt="before" src="https://github.com/user-attachments/assets/a4c04a15-0716-46df-bd4e-7d0284d82573" /> ### Quick Connections Panel, switch on <img width="1277" height="772" alt="show usage pills in quick connection panel when toggle is on" src="https://github.com/user-attachments/assets/0b9369f2-d0a3-4eec-b1f6-195dfb1f6688" /> ### Quick Connections Panel, switch off <img width="1341" height="786" alt="hide usage pills in quick connection panel when toggle is off" src="https://github.com/user-attachments/assets/6e9c5dc7-0fa3-4e74-9c0f-96fdb694859a" /> ### Different Provider, no pills and no usage <img width="1012" height="675" alt="nothing on a different provider" src="https://github.com/user-attachments/assets/66f93f56-2b14-4ff2-b98f-07a2462cff94" /> ### All different pills in view <img width="1097" height="767" alt="all different pills in view" src="https://github.com/user-attachments/assets/cf69b2bf-fdd8-4c9b-8038-7c20cf4d799b" /> ### Mobile View: <img width="515" height="807" alt="mobile view of pills in new connection switcher" src="https://github.com/user-attachments/assets/73075c00-7a97-4033-abde-2732da9682f3" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Model options in the connection editor and model picker display subscription-cost labels when **Show subscription usage** is enabled. This setting is off by default. * Included models show `1x` or a higher multiplier based on weekly allowance usage per token; balance-billed models show **Paid**. * Labels are hidden when the setting is off or for pay-as-you-go users. <!-- 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:20:12 +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#7479
No description provided.