Skip to content

refactor: design & code quality refresh#39

Open
TargetMisser wants to merge 2 commits intomainfrom
design-refresh/code-quality-and-theme-consistency
Open

refactor: design & code quality refresh#39
TargetMisser wants to merge 2 commits intomainfrom
design-refresh/code-quality-and-theme-consistency

Conversation

@TargetMisser
Copy link
Copy Markdown
Owner

Cosa cambia

Coerenza del tema

  • DrawerMenu: icone hardcodate #2563EBcolors.primary (theme-aware, si adatta a chiaro/scuro)
  • DrawerMenu: versione v1.0v1.1.0 (allineata al package.json)
  • CalendarScreen: rimossa costante const PRIMARY = '#2563EB' a livello modulo → colors.primary
  • NotepadScreen: saveBtnDim: { backgroundColor: '#93C5FD' } hardcodato → opacity: 0.55 (funziona con tutti i temi)

Type safety — eliminati tutti gli any nei makeStyles

14 occorrenze di makeStyles(c: any)makeStyles(c: ThemeColors) in 8 file + aggiunto type ThemeColors agli import:

  • DrawerMenu.tsx, ShiftTimeline.tsx, NotepadScreen.tsx, FlightScreen.tsx, HomeScreen.tsx, CalendarScreen.tsx
  • PhonebookScreen.tsx (×3: makeModalStyles, makeRowStyles, makeStyles)
  • PasswordScreen.tsx (×3: makePinStyles, makeRowStyles, makeStyles)
  • ManualsScreen.tsx (×3: makeItemStyles, makeSectionStyles, makeStyles)

Console log solo in dev — no leak in produzione

Tutti i console.error/console.warn (20+ occorrenze) avvolti in if (__DEV__):

  • CalendarScreen.tsx (×6), FlightScreen.tsx (×5), HomeScreen.tsx (×4)
  • PasswordScreen.tsx (×3), autoNotifications.ts (×3), useDynamicTheme.ts (×1), App.tsx (×1)

12 file modificati | ~51 righe inserite / ~52 rimosse

- Fix DrawerMenu: icon color hardcoded #2563EB -> colors.primary (theme-aware)
- Fix DrawerMenu: version label 'v1.0' -> 'v1.1.0' (matches package.json)
- Remove CalendarScreen: module-level const PRIMARY = '#2563EB', replaced with colors.primary
- Fix NotepadScreen: saveBtnDim hardcoded backgroundColor -> opacity: 0.55 (works in all themes)
- Replace all makeStyles(c: any) -> makeStyles(c: ThemeColors) across 8 files (14 occurrences):
  DrawerMenu, ShiftTimeline, NotepadScreen, FlightScreen, HomeScreen, CalendarScreen,
  PhonebookScreen (x3), PasswordScreen (x3), ManualsScreen (x3)
- Add 'type ThemeColors' to imports in all affected files
- Wrap all console.error/warn in if (__DEV__) guard (20+ occurrences):
  CalendarScreen (x6), FlightScreen (x5), HomeScreen (x4), PasswordScreen (x3),
  autoNotifications.ts (x3), useDynamicTheme.ts (x1)
- App.tsx: guard auto-notification count log with __DEV__

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flight-work-app Ready Ready Preview, Comment, Open in v0 Apr 6, 2026 3:20pm

- DrawerMenu: import version from package.json instead of hardcoded string
  - eliminates version drift between package.json and UI
  - requires resolveJsonModule (included in expo/tsconfig.base)
- NotepadScreen: add comment explaining intentional opacity cascade on saveBtnDim
  - opacity: 0.55 dims entire button (icon + label + bg) for 'already saved' state
  - intentional UX: full-button fade signals inactive state
- Add src/utils/devLog.ts utility (devLog/devWarn/devError)
  - centralises __DEV__ guards for future use
  - Metro eliminates dead branches in production bundles

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant