Skip to content

chore(rebrand): phase 4d — rebrand UI components StoryCraft → WorldScript#146

Merged
qnbs merged 11 commits into
mainfrom
rebrand/phase-4d-components
Jun 16, 2026
Merged

chore(rebrand): phase 4d — rebrand UI components StoryCraft → WorldScript#146
qnbs merged 11 commits into
mainfrom
rebrand/phase-4d-components

Conversation

@qnbs

@qnbs qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Part of the StoryCraft → WorldScript rebrand split. This PR updates the user-facing strings inside React components.

Changes

  • Replaces StoryCraft Studio / StoryCraft strings with WorldScript Studio / WorldScript in 14 component files.
  • Covers: CollaborationPanel, CommandPalette, Dashboard, TemplateView, WelcomePortal, BackupQuickActionsCard, LoraDatasetBuilder, PlotCanvas, settings sections (CommunitySection, DataSection, GeneralSections, IdbUnlockModal, LocalAiSection) and ErrorBoundary.

Scope

  • Text-only changes; no logic or prop API changes.

Related


CodeAnt-AI Description

Fix community template apply and keep unlock state working after the rebrand

What Changed

  • Community templates now create a new manuscript and outline, then open the manuscript view instead of doing nothing
  • The new template flow starts with an empty manuscript and puts section guidance in the writing brief
  • Unlock state now reads old StoryCraft saved values, ignores corrupt lockout data, and clears broken or legacy unlock entries so users are not stuck at the unlock screen
  • The About section now shows the exact product name, with translations updated to match
  • Tests now check the community template flow, the exact product name, and the version display

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

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 ·
Reddit ·
LinkedIn

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
storycraft-studio Ready Ready Preview, Comment Jun 16, 2026 7:15am

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jun 15, 2026
Comment thread components/settings/GeneralSections.tsx Outdated
Comment thread components/CommandPalette.tsx Outdated
Comment thread components/settings/IdbUnlockModal.tsx
Comment thread components/dashboard/BackupQuickActionsCard.tsx
Comment thread components/scene-board/PlotCanvas.tsx
Comment thread components/dashboard/BackupQuickActionsCard.tsx
Comment thread components/scene-board/PlotCanvas.tsx
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@qnbs

qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

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 ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels Jun 15, 2026
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

Comment thread components/settings/IdbUnlockModal.tsx
Comment thread components/TemplateView.tsx Outdated
Comment thread components/Dashboard.tsx
Comment thread components/settings/IdbUnlockModal.tsx Outdated
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

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 ·
Reddit ·
LinkedIn

qnbs added a commit that referenced this pull request Jun 15, 2026
#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>
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qnbs

qnbs commented Jun 15, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files size:L This PR changes 100-499 lines, ignoring generated files labels Jun 15, 2026
@codeant-ai

codeant-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

Comment thread components/Dashboard.tsx
Comment thread tests/unit/settings/GeneralSections.test.tsx Outdated
…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>
@qnbs

qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 16, 2026
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

…#146)

Same suppression-ratchet fix as #145: the applyCommunityTemplate test's
`call: any[]` biome-ignore bumped the count 52→53 and failed the Quality Gate.
Refactor the dispatch-call lookup to `unknown[]` + a narrow cast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 16, 2026
Comment thread components/settings/IdbUnlockModal.tsx Outdated
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>
@qnbs

qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

1 similar comment
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 16, 2026
qnbs added a commit that referenced this pull request Jun 16, 2026
… 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>
Comment thread components/settings/IdbUnlockModal.tsx Outdated
Comment thread tests/unit/settings/GeneralSections.test.tsx
qnbs and others added 3 commits June 16, 2026 08:44
…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>
@qnbs

qnbs commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@CodeAnt-AI review

@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Jun 16, 2026
@codeant-ai

codeant-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Sequence Diagram

This 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
Loading

Generated by CodeAnt AI

@qnbs
qnbs merged commit a8cf659 into main Jun 16, 2026
18 checks passed
@qnbs
qnbs deleted the rebrand/phase-4d-components branch June 16, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant