Skip to content

Fix preview typing, add test coverage, dedupe initials, fix billing cancel dialog - #1038

Merged
temma02 merged 4 commits into
StellerCraft:mainfrom
Mystery-CLI:fix/four-issues-batch
Jul 28, 2026
Merged

Fix preview typing, add test coverage, dedupe initials, fix billing cancel dialog#1038
temma02 merged 4 commits into
StellerCraft:mainfrom
Mystery-CLI:fix/four-issues-batch

Conversation

@Mystery-CLI

Copy link
Copy Markdown
Contributor

Summary

Bundles four small, independent frontend fixes:

  • PreviewIframe prop typing (src/components/app/preview/PreviewIframe.tsx): replaced customization?: any with customization?: CustomizationConfig, matching PreviewWorkspaceProps. No behavior change. Added PreviewIframe.test.tsx since no test file existed, asserting the generated iframe src includes the serialized customization.
  • usePreviewService test coverage (src/hooks/usePreviewService.test.ts, new): covers isLoading toggling across success/failure, error being set to the thrown Error's message (with 'Failed to generate preview' fallback for non-Error throws) and re-thrown to the caller, and refreshPreview delegating to generatePreview with the same arguments via a spy on previewService.generatePreview.
  • Shared getInitials helper: extracted the duplicated initials logic out of UserMenu.tsx and MobileDrawer.tsx into src/lib/format/initials.ts, updated both components to import it, and added src/lib/format/initials.test.ts covering single-word names, extra internal whitespace, leading/trailing whitespace, >2 word names, and empty/whitespace-only input.
  • Billing cancel-failure dialog state (src/app/app/settings/billing/page.tsx): handleCancel no longer unconditionally closes the confirm dialog and clears state in finally. On failure the dialog now stays open with an inline role="alert" error message (cancelError state), and cancelling still resets so the retry button re-enables. The dialog only closes on success. Added a failure-path test in page.test.tsx mocking a non-ok /api/payments/cancel response and asserting the dialog stays open with the inline error and no cancellation notice.

Issues closed

Closes #1007
Closes #1006
Closes #1005
Closes #1004

Test plan

  • pnpm typecheck — confirm CustomizationConfig typing compiles cleanly at all call sites
  • pnpm lint
  • pnpm test --filter=frontend -- PreviewIframe
  • pnpm test --filter=frontend -- usePreviewService
  • pnpm test --filter=frontend -- initials
  • pnpm test --filter=frontend -- billing

Mystery-CLI and others added 4 commits July 27, 2026 05:54
…rameProps

Closes StellerCraft#1007

Co-authored-by: Mystery <fidelisobed79@gmail.com>
…rror paths

Closes StellerCraft#1006

Co-authored-by: Mystery <fidelisobed79@gmail.com>
…nd MobileDrawer

Closes StellerCraft#1005

Co-authored-by: Mystery <fidelisobed79@gmail.com>
…ion failure

Closes StellerCraft#1004

Co-authored-by: Mystery <fidelisobed79@gmail.com>
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Mystery-CLI Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@temma02
temma02 merged commit 6220ac6 into StellerCraft:main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants