ui: Constants refactor (#26908)

* refactor: Constants

* refactor: Constants/Enums cleanup

* refactor: Constant objects instead of multiple single value constants

* refactor: Cleanup constants
This commit is contained in:
Aleksander Grygier
2026-08-13 06:53:56 +02:00
committed by GitHub
parent 8e7f22b67e
commit e21152dc96
209 changed files with 1101 additions and 1137 deletions
@@ -0,0 +1,29 @@
/**
* Database-related constants (IndexedDB, Dexie).
*
* Centralized to ensure consistency across the app and simplify future
* naming changes.
*/
import { STORAGE_APP_NAME } from './storage.constants';
/** IndexedDB database name */
export const DB_NAME = STORAGE_APP_NAME;
/** IndexedDB store / table names */
export const IDXDB_TABLES = {
conversations: 'conversations',
messages: 'messages'
} as const;
/** IndexedDB store schemas */
export const IDXDB_STORE_SCHEMAS = {
conversations: 'id, lastModified, currNode, name',
messages: 'id, convId, type, role, timestamp, parent, children'
} as const;
/** Combined Dexie stores definition — keys are table names, values are schemas */
export const IDXDB_STORES = {
[IDXDB_TABLES.conversations]: IDXDB_STORE_SCHEMAS.conversations,
[IDXDB_TABLES.messages]: IDXDB_STORE_SCHEMAS.messages
} as const;