Commit 6f533bc
authored
Facelift changes and model loading UX fix (#1)
* chore: add google_fonts dependency
Required for the Manrope + Inter dual-font system specified
in the Koshika design spec.
* refactor: expand AppColors with semantic, text, and category tokens
Add success/warning/info semantic colors, textPrimary/Secondary/Muted
aliases, surfaceContainerHighest, onErrorContainer, onTertiaryContainer,
and 10 health category colors with a categoryColor() lookup helper.
* feat: create koshika_design_system with typography, spacing, radius, and elevation tokens
Adds KoshikaTypography (Manrope headlines + Inter body with 15 Material
styles and 6 custom health styles), KoshikaSpacing (8dp grid), KoshikaRadius
(sm through pill), KoshikaElevation (tinted BoxShadow presets), and pre-built
card decorations and button styles.
* refactor: remove dark theme, replace ColorScheme.fromSeed with explicit scheme, wire fonts
Switch to light-only theme (ThemeMode.light), replace the seed-generated
ColorScheme with an explicit one mapped to AppColors tokens, wire
Manrope + Inter via KoshikaTypography.textTheme, set card elevation to 0,
and add pill/outlined button theme defaults.
* feat: add KoshikaCard, StatusBadge, and IconContainer widgets
KoshikaCard provides the standard card container with 24px radius,
asymmetric editorial padding, and no-border design. StatusBadge maps
BiomarkerFlag to semantic pill badges with icons. IconContainer wraps
icons in colored rounded-rect backgrounds for list items.
* feat: add shimmer loading widgets
Adds ShimmerScope (shared AnimationController), ShimmerBox, ShimmerLine,
and ShimmerCircle for skeleton loading states. Uses a horizontal gradient
sweep on a 1500ms linear repeat cycle.
* feat: add trend line sparkline painter and haptic feedback service
SimpleTrendLinePainter is a lightweight CustomPainter for compact sparklines
in dashboard category cards. Haptics wraps HapticFeedback with light,
selection, and heavy static methods.
* refactor: migrate dashboard to design system tokens and no-line rule
Replace hardcoded colors, typography, spacing, and radii with
KoshikaTypography, KoshikaSpacing, KoshikaRadius, and KoshikaDecorations.
Hero card uses gradient decoration and heroMetric typography. Category
trend cards now use health category colors. Insights card uses
tertiaryContainer (insight) decoration. Section headers use sectionHeader
style. Border.all removed from insights card (no-line rule).
* refactor: migrate dashboard_summary_card and flag_badge to design system
Replace hardcoded Colors.green/amber/orange/red/grey with AppColors
semantic tokens. Remove Dividers and Border.all (no-line rule). Use
KoshikaTypography, KoshikaDecorations, KoshikaRadius, and KoshikaSpacing.
* refactor: migrate biomarker detail screen to design system
Replace CircularProgressIndicator with shimmer skeleton loading. Use
heroMetric typography for the main biomarker value and StatusBadge pill
for flag display. Add LATEST RESULT and REFERENCE RANGE metric labels.
History list uses alternating row backgrounds instead of Divider
separators. All spacing, radii, and colors use design system tokens.
* refactor: migrate biomarker_trend_chart and reference_range_gauge to design system
Replace hardcoded Colors.green/red/orange with AppColors.success/error/warning.
Use AppColors.secondary for chart line color. Replace Card with Container
using KoshikaDecorations.card. Remove dead isDark branch in gauge painter.
Zone labels use ALL-CAPS with design system-aligned styling.
* refactor: redesign chat UI with glassmorphic input bar and accent-strip bubbles
AI bubbles get 4px left accent strip and KOSHIKA INTELLIGENCE label.
Chat input bar uses BackdropFilter for glassmorphic effect with privacy
label. All state views (download, loading, ready, error, empty) migrated
to design system tokens. Removed borders per no-line rule.
* refactor: redesign reports, report detail, and settings screens
Reports list uses KoshikaCard containers instead of Card widgets.
Report detail uses metricLabel for category headers, removes Dividers.
Settings replaces ListTiles with custom SettingsRow using IconContainer,
model tiles use KoshikaDecorations.card with switch expressions, and
Dividers replaced with spacing per no-line rule.
* refactor: redesign onboarding with gradient CTA and design system tokens
Onboarding pages use design system typography and spacing. Action
button gets gradient pill decoration with medium elevation shadow.
Page indicator dots use AppColors tokens. Icon circles use primary
at 15% opacity for a lighter, editorial feel.
* feat: redesign bottom navigation with glassmorphic bar and animated icons
Custom bottom nav replaces NavigationBar with glassmorphic backdrop
blur (white @ 85%), animated icon transitions between outlined and
filled states, and primaryContainer pill indicator behind selected
item. Uses extendBody for content-behind-nav effect.
* fix: resolve model SDK re-registration and clean up error messages
GemmaService and EmbeddingService now call installModel/installEmbedder
in initialize() when model files already exist on disk. This registers
the model as "active" with the flutter_gemma SDK so that getActiveModel/
getActiveEmbedder succeeds without requiring the user to re-download.
Previously, the services only checked isModelInstalled but never called
install(), causing "No active model set" errors on app re-open.
Chat screen now auto-loads the model on entry when status is ready,
removing the manual "Load Model" tap requirement on every launch.
Session restore on initState removed — chat always starts fresh.
Raw exception strings replaced with user-friendly messages across
SplashScreen and SettingsScreen; raw errors go to debugPrint only.
* fix: correct layout overflow and navigation edge cases
Remove extendBody from HomeScreen — glassmorphic nav bar was obscuring
scrollable content on screens that need full height.
Set centerTitle: false in AppBarTheme so titles align left per the
editorial design spec.
Replace Row with Wrap in dashboard hero card stats so the three stat
items wrap to a second line on narrow screens instead of overflowing.
* fix: auto-load downloaded models in background at startup
After services initialize, kick off loadModel() for both GemmaService
and EmbeddingService if their status is ready (i.e. already downloaded).
Calls are unawaited so navigation proceeds immediately while models warm
up in the background, eliminating the manual Load tap requirement.
* style(lint): add curly braces to if statements
- Wrap single-line if bodies in curly braces per lint rules
- Resolves curly_braces_in_flow_control_structures warnings in dashboard_screen.dart and app_colors.dart
* fix(ui): resolve PR review issues from CodeRabbit
- wrap shimmer skeleton in ListView to prevent overflow on landscape/small screens
- add secondary name sort to make out-of-range list order deterministic
- align unknown flag tooltip color with dot color (both now green)
- replace GestureDetector with Material+InkWell in settings rows for ripple and a11y
- use left BorderSide on chat bubble instead of separate accent strip widget1 parent 65627f0 commit 6f533bc
26 files changed
Lines changed: 2481 additions & 1406 deletions
File tree
- lib
- screens
- services
- theme
- widgets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
57 | 79 | | |
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
61 | 83 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
66 | 88 | | |
67 | | - | |
68 | | - | |
| 89 | + | |
| 90 | + | |
69 | 91 | | |
70 | 92 | | |
71 | | - | |
72 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
73 | 96 | | |
74 | 97 | | |
75 | 98 | | |
76 | | - | |
| 99 | + | |
77 | 100 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 101 | + | |
| 102 | + | |
82 | 103 | | |
83 | 104 | | |
84 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
85 | 111 | | |
86 | 112 | | |
87 | 113 | | |
| |||
116 | 142 | | |
117 | 143 | | |
118 | 144 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
129 | 198 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
146 | 273 | | |
147 | 274 | | |
148 | 275 | | |
| |||
0 commit comments