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
+1 -2
View File
@@ -2,8 +2,7 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { ServerErrorSplash } from '$lib/components/app';
import { APP_NAME } from '$lib/constants';
import { ROUTES } from '$lib/constants/routes';
import { APP_NAME, ROUTES } from '$lib/constants';
let error = $derived($page.error);
let status = $derived($page.status);
+10 -6
View File
@@ -7,10 +7,14 @@
import { SidebarNavigation } from '$lib/components/app';
import { PwaMetaTags, PwaRefreshAlert } from '$lib/components/pwa';
import * as Tooltip from '$lib/components/ui/tooltip';
import { AUTHORIZATION_HEADER, BEARER_PREFIX, TOOLTIP_DELAY_DURATION } from '$lib/constants';
import { SETTINGS_KEYS } from '$lib/constants';
import { FAVICON_PATHS, FAVICON_SELECTORS } from '$lib/constants/pwa';
import { ROUTES } from '$lib/constants/routes';
import {
FAVICON_PATHS,
FAVICON_SELECTORS,
HEADERS,
ROUTES,
SETTINGS_KEYS,
TOOLTIP_DELAY_DURATION
} from '$lib/constants';
import { useKeyboardShortcuts } from '$lib/hooks/use-keyboard-shortcuts.svelte';
import { usePwa } from '$lib/hooks/use-pwa.svelte';
import { RouterService } from '$lib/services/router.service';
@@ -112,8 +116,8 @@
page.status !== 403
) {
const headers: Record<string, string> = {
[AUTHORIZATION_HEADER]: `${BEARER_PREFIX}${apiKey.trim()}`,
'Content-Type': 'application/json'
'Content-Type': 'application/json',
[HEADERS.AUTHORIZATION]: `${HEADERS.BEARER}${apiKey.trim()}`
};
fetch(`${base}/props`, { headers })
+1 -1
View File
@@ -3,7 +3,7 @@
import { goto } from '$app/navigation';
import { page } from '$app/state';
import { SearchInput, SidebarNavigationSearchResults } from '$lib/components/app';
import { ROUTES } from '$lib/constants/routes';
import { ROUTES } from '$lib/constants';
import { RouterService } from '$lib/services/router.service';
import { chatStore } from '$lib/stores/chat.svelte';
import { conversations, conversationsStore } from '$lib/stores/conversations.svelte';