Skip to content

feat: quick generation settings panel in chat - #624

Open
sakebomb wants to merge 1 commit into
a-ghorbani:mainfrom
sakebomb:feat/quick-gen-settings
Open

feat: quick generation settings panel in chat#624
sakebomb wants to merge 1 commit into
a-ghorbani:mainfrom
sakebomb:feat/quick-gen-settings

Conversation

@sakebomb

@sakebomb sakebomb commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a temperature pill (T: X.X) in the chat input control bar showing the current session temperature (shown when a session is active and a model is loaded).
  • Tapping the pill opens a compact bottom sheet with sliders for temperature and top-p, and an Unlimited toggle + max-tokens slider.
  • Changes persist to the session's completion settings immediately via updateSessionCompletionSettings (which flips settingsSource to custom).
  • Reset to defaults restores the system defaults.
  • No new native dependencies.

Max tokens / unlimited

n_predict defaults to -1 (unlimited) since #687 (with a migration flipping existing 1024 → -1). A 64–8192 slider can't represent unlimited, so max tokens is an Unlimited toggle plus a finite slider — mirroring the full Generation Settings sheet's semantics. Turning the toggle off starts the slider at the same 1024 fallback the full sheet uses. This avoids the panel showing a false "64" cap on a default (unlimited) session and silently capping generation on any slider touch.

Test plan

  • Temperature pill appears when a session is active and a model is loaded; hidden otherwise.
  • Tapping the pill opens the QuickGenSettingsSheet.
  • Sliders load the current session's completion settings.
  • Apply saves settings and closes the sheet.
  • Unlimited session → toggle on, slider hidden; toggle off → slider appears at 1024; apply preserves -1 when left on, caps when turned off.
  • Reset restores the unlimited default (temp 0.7, top-p 0.95, max tokens unlimited).
  • No active session → falls back to defaults.
  • tsc, eslint, l10n:validate clean; full suite 269 suites / 4165 passed.
  • Manual device pass (iOS/Android).

Closes #605

@sakebomb
sakebomb force-pushed the feat/quick-gen-settings branch from d8e6355 to 60589d8 Compare July 23, 2026 21:55
Add a compact panel from the chat input bar for adjusting temperature,
top-p, and max tokens without opening the full settings sheet.

- Temperature pill in the chat input showing the current session value
- QuickGenSettingsSheet with sliders for temperature and top-p
- Max tokens: an "Unlimited" toggle plus a finite slider, mirroring the
  full Generation Settings sheet's n_predict semantics. n_predict = -1
  (unlimited) is the default since a-ghorbani#687, so the slider (64–8192) alone
  could not represent it — opening the panel on a default session would
  show a false "64" cap and any slider touch would silently cap an
  otherwise-unlimited session. The toggle represents -1 directly; turning
  it off starts the slider at the same 1024 fallback the full sheet uses.
- Changes apply to the session's completion settings immediately
  (settingsSource flips to 'custom'); Reset restores the unlimited default
- Tests cover the finite/unlimited/toggle-off/reset/no-session paths

Closes a-ghorbani#605
@sakebomb
sakebomb force-pushed the feat/quick-gen-settings branch from 60589d8 to d671a5e Compare August 13, 2026 14:09
@sakebomb

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and did a self-review pass. One real defect surfaced that only appears against current main:

n_predict now defaults to -1 (unlimited) (via #687 + a migration flipping existing 1024 → -1). The original max-tokens slider was 64–8192, so on a default session it displayed a false "64" cap, and any drag would silently cap an otherwise-unlimited session. Fixed by making max tokens an Unlimited toggle + finite slider, mirroring the full Generation Settings sheet (finite fallback 1024).

Also corrected here: the shared test mock's defaultCompletionSettings.n_predict was stale at 1024 (now -1, matching the real default), and the sheet's tests were rewritten to actually exercise the unlimited/finite/toggle-off/reset paths (the old ones asserted a 1024 default that no longer exists). Both the toggle-save and slider-visibility guards are mutation-verified.

Verification: tsc clean · eslint clean · l10n:validate valid · full suite 269 suites / 4165 passed. No native changes.

Sign up for free to 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.

[Feat]: Quick generation settings panel in chat

1 participant