Add test suite, fix UX anti-patterns, and improve type safety#17
Draft
Add test suite, fix UX anti-patterns, and improve type safety#17
Conversation
Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
…r, add pagination, migrate inline styles, improve types Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add test suite and improve UX patterns
Add test suite, fix UX anti-patterns, and improve type safety
Mar 11, 2026
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.
Zero test coverage on a security-sensitive extension,
alert()/confirm()blocking the popup UI, a fake progress bar incrementing 10% every 500ms regardless of reality, a hard 6-item gallery cap with no escape, and pervasiveanytypes despitestrict: true.Test suite (Vitest)
vitest+happy-domadded;chrome.storage/chrome.runtimemocked insrc/tests/setup.tsApiClient.test.ts(20) andStorageService.test.ts(24)"test"/"test:watch"/"test:coverage"scripts added topackage.jsonbuildUrlwas emitting a trailing?when all params werenull/undefined— fixed inApiClient.tsUX: replace native dialogs
alert()/confirm()replaced with inline React components that don't block the popup:ErrorToast— dismissible red banner for operation failuresConfirmDialog— modal overlay reusing existing notification styles for logout confirmationHonest upload indicator
The fake 10 %/500 ms interval simulation is gone. The upload status bar now uses a CSS indeterminate animation (
@keyframes indeterminate-progress) that honestly reflects "in progress, duration unknown."Asset gallery pagination
Hard
slice(0, 6)cap replaced with a statefulvisibleCount(initial page = 6) and a "Show more (N remaining)" button that loads the next page on click. Count resets when the asset list changes.Inline styles → CSS classes
SharePromptModal,CaptureSection(mode toggle + spinner),PopupHeader, andAssetThumbnailhunt-share buttons all migrated from inlinestyle={{}}objects to named CSS classes.onMouseOver/onMouseOutJS hover simulation removed in favour of CSS:hover.Type safety
popup.tsxmessage handlermessage: anyExtensionMessage/UploadProgressPayloadinterfacesUploadServiceupload resultresult: anyUploadApiResultinterfaceUploadServiceerror handlerserror: anyerror: unknownUploadServicesigned metadatametadata: anyRecord<string, unknown>ApiClientmethod signaturesbody?: any,params?: Record<string, any>unknown/Record<string, unknown>Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.