Conversation
…or handling, type safety - Refactor analytics.ts to use shared apiFetch/apiGet/apiPost helpers instead of duplicating fetchAuthSession + raw fetch in every function (~150 lines removed) - Consolidate useIsAdmin, useUserGroups, useCanSendCommands onto a single shared TanStack Query cache entry to eliminate redundant Cognito round-trips - Fix DisplayPreferences and FleetDefaults to only clear hasChanges on mutation onSuccess callback, preventing silent save button disable on API failure - Add error feedback UI to both settings components on mutation failure - Fix catch (error: any) in Analytics.tsx with proper TypeScript narrowing - Replace index-based chat message keys with stable type+timestamp identity - Tighten QueryResult.data from any[] to QueryRow[] (Record<string, string|number|boolean|null>[]) - Fix missing Satellite import in DeviceDetail.tsx Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Resolve DeviceDetail.tsx conflict (keep Satellite icon import) - Rewrite analytics.test.ts to mock ./client helpers instead of fetch - Add QueryClientProvider wrapper to useAuth.test.tsx renderHook calls Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…cs-auth-errors # Conflicts: # songbird-dashboard/src/components/settings/FleetDefaults.tsx # songbird-dashboard/src/pages/DeviceDetail.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
analytics.tsAPI functions to use sharedapiFetch/apiPost/apiGetinstead of duplicating auth token plumbing in every function (~150 lines removed)useIsAdmin,useUserGroups,useCanSendCommandsonto a single shared TanStack Query cache entry — eliminates redundantfetchAuthSession()calls when multiple components mount simultaneouslyDisplayPreferencesandFleetDefaultsto only clearhasChangesafter a successful save, not before — prevents silently disabling the save button when the API call fails; also adds error feedback UI to bothcatch (error: any)inAnalytics.tsxto use proper TypeScript narrowingkeyon chat messages to use stabletype-timestampidentityQueryResult.datafromany[]toRecord<string, string | number | boolean | null>[]via newQueryRowtype aliasSatellitelucide import inDeviceDetail.tsxTest plan
npx tsc --noEmit)🤖 Generated with Claude Code