Files
openchamber/packages/web/server/lib/opencode/input-history-scope.js
T
Matt VisnovskyandBohdan Triapitsyn 1d6b15bc04 feat(chat): persist more composer input history with global or session scope; recallable with up/down arrow keys (#3035)
* feat(chat): persist input history

* feat(settings): configure input history scope

* fix(web): keep input history validation packaged

* fix(chat): preserve input history across tabs

* fix(settings): restore prompt history limit

* fix(settings): keep history deletion warning visible

* fix(i18n): restore Turkish Git empty state translations

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-09-05 19:19:03 +03:00

15 lines
422 B
JavaScript

export const DEFAULT_INPUT_HISTORY_SCOPE = 'global';
export const DEFAULT_INPUT_HISTORY_LIMIT = 40;
const MIN_INPUT_HISTORY_LIMIT = 1;
const MAX_INPUT_HISTORY_LIMIT = 100;
export const isInputHistoryScope = (value) => (
value === 'global' || value === 'session'
);
export const isInputHistoryLimit = (value) => (
Number.isInteger(value)
&& value >= MIN_INPUT_HISTORY_LIMIT
&& value <= MAX_INPUT_HISTORY_LIMIT
);