[eric] add warning banner (no internet / no model connected) with ErrorSlime mascot, smooth Collapse transition, click-to-open Settings →

Models tab
This commit is contained in:
ciregenz
2026-04-09 17:17:02 -07:00
parent 98aa3a60f1
commit 4c5c6ff3d3
4 changed files with 132 additions and 3 deletions
+7 -2
View File
@@ -1,4 +1,4 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
import { API_BASE } from '@/shared/config';
const SETTINGS_API = `${API_BASE}/settings`;
@@ -60,6 +60,8 @@ interface SettingsState {
loading: boolean;
loaded: boolean;
modalOpen: boolean;
/** When non-null, Settings opens to this tab instead of 'general'. */
initialTab: string | null;
}
const initialState: SettingsState = {
@@ -82,6 +84,7 @@ const initialState: SettingsState = {
loading: false,
loaded: false,
modalOpen: false,
initialTab: null,
};
export const fetchSettings = createAsyncThunk('settings/fetch', async () => {
@@ -124,11 +127,13 @@ const settingsSlice = createSlice({
name: 'settings',
initialState,
reducers: {
openSettingsModal(state) {
openSettingsModal(state, action: PayloadAction<string | undefined>) {
state.modalOpen = true;
state.initialTab = action.payload ?? null;
},
closeSettingsModal(state) {
state.modalOpen = false;
state.initialTab = null;
},
},
extraReducers: (builder) => {