chore(rebrand): phase 4d — rebrand UI components StoryCraft → WorldScript#146
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
CodeAnt AI finished reviewing your PR. |
|
@CodeAnt-AI review |
|
CodeAnt AI is running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram shows how the IDB unlock modal now reads and migrates legacy lockout state from old storage keys to new ones while continuing to track failed attempts and lockout timing during passphrase entry. sequenceDiagram
participant User
participant IdbUnlockModal
participant LocalStorage
IdbUnlockModal->>LocalStorage: Read attempts and lockout (migrate legacy keys if present)
LocalStorage-->>IdbUnlockModal: Current attempt count and lockout time
User->>IdbUnlockModal: Submit passphrase
IdbUnlockModal->>IdbUnlockModal: Check lockout and validate passphrase
alt Wrong passphrase
IdbUnlockModal->>LocalStorage: Increment attempts and update lockout timestamp (new keys)
else Correct passphrase
IdbUnlockModal->>LocalStorage: Clear attempts and lockout (new and legacy keys)
IdbUnlockModal-->>User: Unlock encrypted data
end
Generated by CodeAnt AI |
|
CodeAnt AI finished running the review. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
#146) - Community templates were a silent no-op: TemplateView dispatched a `*:applyTemplate` window event that has no listener anywhere (pre-existing on main, the rebrand only renamed the prefix). Add `applyCommunityTemplate` to useTemplateView — it builds the manuscript/outline from the community sections and dispatches setManuscript/setOutline + navigates, mirroring the working built-in-template path — and call it from CommunityTab, removing the dead window event. New unit test covers the section→content mapping. - IdbUnlockModal.readInt: corrupt/non-numeric localStorage values parsed to NaN and poisoned the lockout math (Date.now() + NaN) and countdown UI. Normalize any invalid parse to 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR makes community templates actually create a manuscript and open the manuscript view, and it migrates and hardens IDB unlock lockout state so legacy keys and corrupt values no longer break the countdown. sequenceDiagram
participant User
participant TemplateView
participant TemplateViewHook
participant ProjectStore
participant Router
participant IdbUnlockModal
participant BrowserStorage
User->>TemplateView: Select community template
TemplateView->>TemplateViewHook: applyCommunityTemplate(template)
TemplateViewHook->>ProjectStore: Set manuscript from template sections
TemplateViewHook->>ProjectStore: Set outline from template sections
TemplateViewHook->>Router: Navigate to manuscript view
User->>IdbUnlockModal: Open encrypted library
IdbUnlockModal->>BrowserStorage: Read attempts and lockout via primary and legacy keys
BrowserStorage-->>IdbUnlockModal: Normalized numbers with invalid as zero
IdbUnlockModal->>IdbUnlockModal: Compute lockout and countdown safely
IdbUnlockModal->>BrowserStorage: Clear primary and legacy keys after unlock
Generated by CodeAnt AI |
…nt (#146 wave-3) applyCommunityTemplate wrote each section's description into the manuscript `content` (with an injected `# heading`), making a freshly applied template look pre-written. Move the guidance into `prompt` (the writing brief) and start the manuscript content empty — mirroring the built-in-template path. Test updated to assert content is empty and the guidance lands in prompt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR wires community templates to create real projects and hardens the IDB unlock modal to migrate legacy lockout keys and normalize stored counters after the WorldScript rebrand. sequenceDiagram
participant User
participant TemplateView as Community template view
participant TemplateViewHook as Template view hook
participant ReduxStore as Redux store
participant ManuscriptView as Manuscript view
participant UnlockModal as IDB unlock modal
participant LocalStorage as Device storage
User->>TemplateView: Choose community template
TemplateView->>TemplateViewHook: applyCommunityTemplate(selected template)
TemplateViewHook->>ReduxStore: Save manuscript and outline from template sections
ReduxStore-->>TemplateViewHook: Project state updated
TemplateViewHook->>ManuscriptView: Navigate to manuscript with new project
UnlockModal->>LocalStorage: Read attempts and lockout keys with migration
LocalStorage-->>UnlockModal: Normalized attempt count and lockout timestamp
User->>UnlockModal: Enter passphrase
UnlockModal->>LocalStorage: Update attempts or clear all lockout keys
UnlockModal-->>User: Unlock encrypted data or show lockout countdown
Generated by CodeAnt AI |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
readInt only rejected NaN, so a corrupt/huge stored value produced a far-future lockout timestamp that blocked unlock indefinitely. Add a per-caller max clamp: the lockout timestamp is bounded to now + 60s (the lockoutMs backoff cap) and the attempt counter to a small max, so a corrupt value can never permanently lock out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
1 similar comment
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
… identifiers (#145) * chore(rebrand): phase 4c — remaining source strings, storage keys and identifiers * chore(rebrand): remove Rust command renames from phase 4c These changes now live in phase 4b to keep the TS bridge and Rust commands consistent within one PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(rebrand): complete half-applied AI-identifier rename on phase-4c The branch had a half-applied rename that broke typecheck (red CI): fetchAdapter exported createWorldScriptFetch and 4 test files already used it, but services/ai/index.ts, providerFactory.ts and storyCraftAi.test.ts still imported the old createStoryCraftFetch; likewise providerFactory.test.ts expected createLanguageModelForWorldScript while the source still defined the StoryCraft name. Complete both renames forward (createStoryCraftFetch → createWorldScriptFetch, createLanguageModelForStoryCraft → createLanguageModelForWorldScript) across the 5 laggard files. Pure internal-symbol rename — all 67 affected AI tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(rebrand): address CodeAnt #145 — a11y CSS selectors + centralized brand value - Accessibility CSS broke: App.tsx emits worldscript-* classes but index.css still targeted .storycraft-* — reduced-motion, large-text, screen-reader and focus-indicators silently stopped working. Rename the 4 a11y selectors to worldscript-* (the unrelated storycraft-driver-popover tour selectors are left as-is since that class was not renamed). - Introduce constants/brand.ts (APP_NAME, APP_FILE_SLUG) as the single source for the product name + filesystem slug, and use it for the previously-hardcoded brand text (CommandPalette footer, Settings About heading) and export filenames (LoRA dataset, library backup, settings export). Brand strings stay out of the i18n catalog by design — a product name is identical across locales and must never be accidentally translated. - Persisted storage identifiers (IDB DB names, lockout/onboarding/language keys) keep their worldscript-* names: this is a pre-release rebrand with no existing users, so there is no legacy state to migrate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(rebrand): wire community-template apply on phase-4c (#145 wave-2) Same fix as #146: community templates dispatched a `*:applyTemplate` window event with no listener anywhere, so applying one was a silent no-op. Add applyCommunityTemplate to useTemplateView (setManuscript/setOutline + navigate, mirroring the built-in-template path) and call it from CommunityTab, removing the dead event. New unit test covers the section→content mapping. (Both branches carry the identical fix; the merge reconciles trivially.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(rebrand): gate motion.css animations on worldscript-reduced-motion (#145 wave-3) App.tsx applies the `worldscript-reduced-motion` body class, but styles/motion.css still gated its 8 component enter/exit animations on `.storycraft-reduced-motion`, so enabling reduced-motion did not actually disable them. Rename the selectors to `.worldscript-reduced-motion` (companion to the index.css selectors fixed in wave-1). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(rebrand): drop new biome-ignore in template test — use unknown[] (#145) The applyCommunityTemplate test added a `biome-ignore noExplicitAny` (`call: any[]`) which bumped the suppression ratchet 52→53 and failed the Quality Gate. Refactor the dispatch-call lookup to `unknown[]` + a narrow cast so no suppression is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…onents # Conflicts: # components/CommandPalette.tsx # components/lora/LoraDatasetBuilder.tsx # components/settings/DataSection.tsx # components/settings/GeneralSections.tsx # components/settings/IdbUnlockModal.tsx # hooks/useTemplateView.ts # tests/unit/hooks/useTemplateView.test.ts # tests/unit/settings/GeneralSections.test.tsx
- getLockoutUntil clamped to a MOVING `now + MAX_LOCKOUT_MS` on every read, so a corrupt far-future timestamp re-clamped to "now+60s" each tick and never counted down — a permanent lockout. Treat a beyond-bound value as invalid → 0 (no lockout). - GeneralSections "renders app version information" test only asserted the product name; add an assertion that packageJson.version actually renders, so a version regression fails the test as its name implies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram shows how community templates now create a manuscript and navigate to the manuscript view, and how the IDB unlock modal migrates and normalizes legacy lockout state from storage to prevent silent failures after the rebrand. sequenceDiagram
participant User
participant CommunityTemplatesUI
participant TemplateViewHook
participant ProjectStore
participant Navigation
participant UnlockModal
participant Storage
Note over User,Navigation: Community template apply
User->>CommunityTemplatesUI: Select community template
CommunityTemplatesUI->>TemplateViewHook: applyCommunityTemplate(template)
TemplateViewHook->>ProjectStore: Set manuscript and outline from template sections
TemplateViewHook->>Navigation: Go to manuscript view
Note over User,Storage: Unlock lockout read and migration
User->>UnlockModal: Open unlock dialog
UnlockModal->>Storage: Read attempts and lockout with legacy keys
Storage-->>UnlockModal: Return migrated and clamped values
UnlockModal->>UnlockModal: Decide lockout or allow passphrase entry
Generated by CodeAnt AI |
User description
Summary
Part of the StoryCraft → WorldScript rebrand split. This PR updates the user-facing strings inside React components.
Changes
CollaborationPanel,CommandPalette,Dashboard,TemplateView,WelcomePortal,BackupQuickActionsCard,LoraDatasetBuilder,PlotCanvas, settings sections (CommunitySection,DataSection,GeneralSections,IdbUnlockModal,LocalAiSection) andErrorBoundary.Scope
Related
CodeAnt-AI Description
Fix community template apply and keep unlock state working after the rebrand
What Changed
Impact
✅ Working community template apply✅ Fewer unlock screen failures after upgrade✅ Consistent WorldScript branding💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.