Skip to content

fix(web): add loading state and per-subtype display to UniversalTab#426

Merged
Movm merged 1 commit intomasterfrom
fix/universal-tab-loading-and-display
Jan 29, 2026
Merged

fix(web): add loading state and per-subtype display to UniversalTab#426
Movm merged 1 commit intomasterfrom
fix/universal-tab-loading-and-display

Conversation

@Movm
Copy link
Copy Markdown
Collaborator

@Movm Movm commented Jan 29, 2026

Summary

  • Loading spinner: Add isLoading state to UniversalTab with try/finally in handleSubmit, and pass loading={isLoading} to BaseForm so the submit button spinner works
  • Per-subtype content storage: Change componentName from static 'universal-text' to dynamic universal-text-${selectedType} so each sub-type (Rede, Wahlprogramm, etc.) gets its own slot in the generated text store — display section now correctly shows/hides content when switching sub-types
  • Remove forced remount: Remove key={selectedType} on BaseForm since distinct componentName values handle isolation naturally
  • hasGeneratedContent check: Extend the check in TexteGenerator to also look at per-subtype keys so the layout detects content from any universal sub-type

Test plan

  • Navigate to Sonstige tab, select "Rede", submit → loading spinner appears
  • Generated content appears in display section after submit
  • Switch to "Bürger*innenanfragen" → display section clears
  • Submit for "Bürger*innenanfragen" → loading + display works
  • Switch back to "Rede" → previously generated content reappears

The UniversalTab (Sonstige) had two bugs:
- No loading spinner because loading prop was never
  passed to BaseForm
- Display section didn't update when switching sub-types
  because all shared a single store key

Add isLoading state with try/finally in handleSubmit
and pass it to BaseForm. Use per-subtype componentName
(e.g. universal-text-rede) so each sub-type gets its
own storage slot. Remove key={selectedType} forced
remount. Update hasGeneratedContent in TexteGenerator
to also check sub-type keys.
@Movm Movm merged commit bc3d69c into master Jan 29, 2026
9 of 10 checks passed
@Movm Movm deleted the fix/universal-tab-loading-and-display branch March 10, 2026 16:15
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