mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix: update settings and skills handling with assistant redirect (#220)
* fix: enable swipe-back suspension on more drawer and remove unused variable * refactor(frontend): improve dialog component and settings navigation * fix: disable route swipe suspension in MoreDrawer to prevent unintended navigation * fix(frontend): enable swipe-back suspension on more drawer route * refactor(frontend): improve mobile navigation drawer and tab bar * feat: add schedules service and workspace hook with navigation updates * chore: add workspace hook, schedules library, and tests * fix: prevent MoreDrawer sentinel from undoing navigation * feat: per-agent model selection and UI refinements (#217) * feat: per-agent model selection and UI refinements - Add agentModels store with setAgentModel/getAgentModel - PromptInput uses session model priority and stores agent model on change - useContextUsage derives model from assistant message instead of global - Migrate sub-agent/subtask badges from purple to blue with refined styling - Fix MoreDrawer sentinel to skip history-back on navigation * refactor: improve per-agent model selection and task tool call status indicators * feat: add repo management skill and internal repos API * fix: improve assistant session launcher and UI components * fix: update atomic-json test assertions * refactor: split Assistant Mode instructions between AGENTS.md and assistant.md * loop: todo-header-mobile completed after 3 iterations (#218) * loop: stt-perf-1 completed after 5 iterations * fix: load audio worklet per recording context * fix: canonicalize assistant navigation routes * fix: adjust scroll-up threshold for header visibility * fix: update settings and skills handling with assistant redirect * refactor: simplify context usage indicator and extract token sum helper * feat: add currently selected model row to popover and fix responsive truncate
This commit is contained in:
1 parent
c7291518c8
commit
74cdeb3926
73 files changed
+4073
-632
No files matched your search
@@ -9,6 +9,7 @@ export interface ModelSelection {
|
||||
|
||||
interface ModelStore {
|
||||
model: ModelSelection | null
|
||||
agentModels: Record<string, ModelSelection>
|
||||
recentModels: ModelSelection[]
|
||||
favoriteModels: ModelSelection[]
|
||||
variants: Record<string, string | undefined>
|
||||
@@ -16,6 +17,8 @@ interface ModelStore {
|
||||
|
||||
setModel: (model: ModelSelection) => void
|
||||
setActiveModel: (model: ModelSelection) => void
|
||||
setAgentModel: (agent: string, model: ModelSelection) => void
|
||||
getAgentModel: (agent: string) => ModelSelection | null
|
||||
syncModelState: (state: { recent: ModelSelection[], favorite: ModelSelection[], variant: Record<string, string | undefined> }) => void
|
||||
toggleFavorite: (model: ModelSelection) => void
|
||||
syncFromConfig: (configModel: string | undefined, force?: boolean) => void
|
||||
@@ -39,6 +42,7 @@ export const useModelStore = create<ModelStore>()(
|
||||
persist(
|
||||
(set, get) => ({
|
||||
model: null,
|
||||
agentModels: {},
|
||||
recentModels: [],
|
||||
favoriteModels: [],
|
||||
variants: {},
|
||||
@@ -64,6 +68,20 @@ export const useModelStore = create<ModelStore>()(
|
||||
set({ model })
|
||||
},
|
||||
|
||||
setAgentModel: (agent: string, model: ModelSelection) => {
|
||||
set((state) => ({
|
||||
agentModels: {
|
||||
...state.agentModels,
|
||||
[agent]: model,
|
||||
},
|
||||
}))
|
||||
},
|
||||
|
||||
getAgentModel: (agent: string) => {
|
||||
const state = get()
|
||||
return state.agentModels[agent] ?? null
|
||||
},
|
||||
|
||||
syncModelState: (modelState) => {
|
||||
set((state) => ({
|
||||
recentModels: modelState.recent,
|
||||
@@ -182,6 +200,7 @@ export const useModelStore = create<ModelStore>()(
|
||||
name: 'opencode-model-selection',
|
||||
partialize: (state) => ({
|
||||
model: state.model,
|
||||
agentModels: state.agentModels,
|
||||
recentModels: state.recentModels,
|
||||
favoriteModels: state.favoriteModels,
|
||||
variants: state.variants,
|
||||
|
||||
@@ -8,12 +8,14 @@ interface UIStateStore {
|
||||
activePromptFileBasePath: string | null
|
||||
pendingPromptCommand: { id: number; command: CommandType } | null
|
||||
pendingPromptFile: { id: number; path: string } | null
|
||||
isMoreDrawerOpen: boolean
|
||||
setIsEditingMessage: (isEditing: boolean) => void
|
||||
setActivePromptFileBasePath: (basePath: string | null) => void
|
||||
selectPromptCommand: (command: CommandType) => void
|
||||
clearPendingPromptCommand: () => void
|
||||
selectPromptFile: (path: string) => void
|
||||
clearPendingPromptFile: () => void
|
||||
setMoreDrawerOpen: (open: boolean) => void
|
||||
}
|
||||
|
||||
export const useUIState = create<UIStateStore>((set) => ({
|
||||
@@ -21,10 +23,12 @@ export const useUIState = create<UIStateStore>((set) => ({
|
||||
activePromptFileBasePath: null,
|
||||
pendingPromptCommand: null,
|
||||
pendingPromptFile: null,
|
||||
isMoreDrawerOpen: false,
|
||||
setIsEditingMessage: (isEditing: boolean) => set({ isEditingMessage: isEditing }),
|
||||
setActivePromptFileBasePath: (basePath: string | null) => set({ activePromptFileBasePath: basePath }),
|
||||
selectPromptCommand: (command: CommandType) => set({ pendingPromptCommand: { id: Date.now(), command } }),
|
||||
clearPendingPromptCommand: () => set({ pendingPromptCommand: null }),
|
||||
selectPromptFile: (path: string) => set({ pendingPromptFile: { id: Date.now(), path } }),
|
||||
clearPendingPromptFile: () => set({ pendingPromptFile: null }),
|
||||
setMoreDrawerOpen: (open: boolean) => set({ isMoreDrawerOpen: open }),
|
||||
}))
|
||||
Reference in new issue
Block a user