feat: add Spinner and LoadingState components for unified loading UX

Introduces two reusable loading components to standardize loading states:
- Spinner: Base spinner with accessibility support (role, aria-label)
- LoadingState: Semantic loading indicator combining spinner and label

Updates loading patterns across the app:
- Full-screen/block loading now uses LoadingState (App, router, files, file)
- Inline button loading states show spinner + text with aria-busy
- Message list loading replaced with MessageSkeleton component
- Removes duplicate SpinnerIcon definition from PermissionFooter

Improves UX and accessibility:
- Loading screens centered and full-height
- Consistent ellipsis character (…)
- Semantic accessibility (role="status", aria-live, aria-busy)
- Adds CSS variables for banner styling
This commit is contained in:
weishu
2025-12-24 17:23:39 +08:00
parent 9b9f792ff6
commit 7f2a36117c
14 changed files with 317 additions and 31 deletions
+4
View File
@@ -9,6 +9,8 @@
--app-link: var(--tg-theme-link-color, #111827);
--app-button: var(--tg-theme-button-color, #111827);
--app-button-text: var(--tg-theme-button-text-color, #ffffff);
--app-banner-bg: var(--tg-theme-button-color, #111827);
--app-banner-text: var(--tg-theme-button-text-color, #ffffff);
--app-secondary-bg: var(--tg-theme-secondary-bg-color, #f3f4f6);
/* Theme-aware colors (light mode defaults) */
@@ -51,6 +53,8 @@
--app-link: var(--tg-theme-link-color, #ffffff);
--app-button: var(--tg-theme-button-color, #ffffff);
--app-button-text: var(--tg-theme-button-text-color, #111827);
--app-banner-bg: var(--tg-theme-button-color, #3A3A3C);
--app-banner-text: var(--tg-theme-button-text-color, #ffffff);
--app-secondary-bg: var(--tg-theme-secondary-bg-color, #2C2C2E);
--app-border: rgba(255, 255, 255, 0.1);