refactor(web): consolidate ApiClient, clean stale config, expand tests - #320
Merged
Conversation
- Migrate the four standalone alert-rule functions and fetchAttachments into ApiClient methods, removing the duplicated 401/boilerplate fetch code and the migrate TODO; call sites in rules and event detail pages updated to the shared client - Drop the stale tailwind.config.js reference from components.json (Tailwind v4 is CSS-config only) - Component tests for Pagination and EmptyState via @testing-library/svelte; vitest gains the svelte plugin + browser resolve condition; unit tests for rowKeyActivate and crashRateBarClass - New mobile e2e spec: drawer navigation and no-horizontal-overflow check at 390px
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.
What
fetchAttachmentsintoApiClientmethods (removes the duplicated raw-fetch/401 boilerplate and resolves the long-standing TODO inapi.ts); rules and event-detail call sites now use the shared clienttailwind.config.jsreference fromcomponents.json(Tailwind v4 is CSS-config only)PaginationandEmptyStateusing the previously-unused@testing-library/svelte; vitest config gains the svelte plugin + browser resolve condition to support Svelte 5 client rendering under jsdomrowKeyActivateandcrashRateBarClassWhy
The API layer was split between the class and copy-pasted standalone fetch functions (error/401 handling drift risk). Test coverage had zero component tests and no mobile-viewport e2e, despite the dashboard now having a mobile-specific drawer.
Testing
npm run check(0 errors) andnpm run buildpass