Skip to content

feat(desktop): add v1 import intro page + fix preset import#4151

Merged
saddlepaddle merged 2 commits into
mainfrom
add-v2-interstitial-page
May 6, 2026
Merged

feat(desktop): add v1 import intro page + fix preset import#4151
saddlepaddle merged 2 commits into
mainfrom
add-v2-interstitial-page

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented May 6, 2026

Summary

  • Split the v1 import welcome screen into two pages: the existing "Welcome to Superset v2" hero (copy removed) and a new IntroPage that sets expectations — "let's get your workspaces and projects ported over. Terminal sessions won't be carried over, but you can still access v1 at any time."
  • Fix the preset import path that threw Invalid input - path: id for builtin agent presets (claude, codex). v1 keys those presets by agent name; v2 requires id to be a UUID. The import now generates a fresh UUID, sets agentId for the link, and dedups on agentId (builtins) or name (custom) instead of v1's id.

Test plan

  • Open v1→v2 import modal, click through Welcome → Intro → Projects (Back/Next both directions).
  • On the Presets page, import a builtin agent preset (Claude / Codex) and verify it lands in v2 with the right label and a UUID id.
  • Verify the imported row is marked "Imported" (dedup by agentId) on subsequent renders.
  • Import a custom-named v1 preset and verify it lands without an agentId and dedups by name.

Summary by cubic

Split the v1→v2 import flow into a welcome hero and a short intro to set expectations. Also fixed builtin preset import errors, label mismatch, and tightened deduping.

  • New Features

    • Added an Intro page after Welcome. Clarifies that workspaces and projects migrate, terminal sessions do not. Updated page order and a11y titles/descriptions.
  • Bug Fixes

    • Fixed preset import for builtin agents (claude, codex): generate a UUID for id, set agentId for linking, dedup by agentId (builtins) or name (custom), show the v2 display label in the picker, and exclude builtin-linked rows from name-based dedup to avoid false “Imported”.

Written for commit e20b4e2. Summary will update on new commits.

Summary by CodeRabbit

New Features

  • Added an introductory step to the V1 import wizard that explains what will and won't be transferred during the migration process
  • Enhanced preset importing to automatically match presets with corresponding built-in agents and display appropriate labels

Splits the v1 import welcome screen into two pages: the existing
"Welcome to Superset v2" hero (now copy-free) and a new intro page that
sets expectations — workspaces and projects port over, terminal sessions
don't, and v1 stays accessible.

Also fixes the preset import flow, which threw "Invalid input - path: id"
for builtin agent presets ("claude", "codex"). v1 stores those with the
agent name as the preset id, but v2's schema requires id to be a UUID.
The import now generates a fresh UUID for the v2 row, sets agentId for
the link, and dedups on agentId (builtins) or name (custom presets)
instead of v1's id.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR splits the v1→v2 import welcome screen into two pages (WelcomePage + new IntroPage) and fixes preset import for builtin agent presets (claude, codex) whose v1 id was a name string rather than a UUID.

  • IntroPage is added as a new static step between "Welcome" and the import pages; navigation and store order are updated correctly.
  • Preset import fix: builtin presets now get a fresh crypto.randomUUID() id and an agentId link; dedup is split between agentId (builtins) and name (custom presets).
  • The ImportRow still renders preset.name (the raw v1 key) rather than the resolved v2Name, so builtin rows display "claude" in the picker but land in v2 as "Claude Code".

Confidence Score: 3/5

Safe to merge with the display-name mismatch resolved — the preset import logic is otherwise correct, but builtin preset rows currently show the raw v1 key in the picker while the imported record lands in v2 with the human-readable display label.

The preset import fix is solid — fresh UUIDs, agentId linking, and split dedup all look correct. The remaining gap is that ImportRow renders preset.name rather than v2Name, so users see the raw v1 agent key in the UI instead of the human-readable label they'll find in v2 after import. The custom-preset dedup also has a latent false-positive if any custom preset name collides with a builtin display label.

ImportPresetsPage.tsx — the ImportRow primary label and the importedNames set construction both warrant a second look.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx Core preset import logic refactored: dedup now uses agentId for builtins and name for custom presets; id is now a fresh UUID. The ImportRow still displays the v1 preset name (e.g. "claude") while the imported v2 row gets the display label (e.g. "Claude Code"), creating a visual mismatch.
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/V1ImportModal.tsx Added IntroPage between welcome and projects; DialogTitle and navigation logic updated correctly. DialogDescription is now static (always shows intro copy), which is minor since it's sr-only.
apps/desktop/src/renderer/stores/v1-import-modal.ts Added "intro" to V1ImportPage type and V1_IMPORT_PAGE_ORDER; straightforward and correct.
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/IntroPage/IntroPage.tsx New static intro page component; simple, no issues.
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/IntroPage/index.ts Barrel export for IntroPage; correct.
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/WelcomePage/WelcomePage.tsx Removed the descriptive subtitle from WelcomePage, leaving just the title; straightforward removal.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([Open Modal]) --> B[WelcomePage]
    B -->|Get started| C[IntroPage - NEW]
    C -->|Next| D{activeHostUrl ready?}
    D -->|Yes| E[ImportProjectsPage]
    D -->|No| F[Waiting screen]
    F --> E
    E -->|Next| G{activeHostUrl ready?}
    G -->|Yes| H[ImportWorkspacesPage]
    G -->|No| I[Waiting screen]
    I --> H
    H -->|Next| J[ImportPresetsPage]
    J -->|Done| K([Close Modal])

    subgraph Preset import logic
        L[v1 preset] --> M{Is builtin agent name?}
        M -->|Yes| N[linkedAgentId = preset.name\nv2Name = AGENT_LABELS lookup]
        M -->|No| O[linkedAgentId = undefined\nv2Name = preset.name]
        N --> P{importedAgentIds has linkedAgentId?}
        O --> Q{importedNames has v2Name?}
        P -->|Yes| R[Show Imported]
        Q -->|Yes| R
        P -->|No| S[Show Import button]
        Q -->|No| S
        S -->|clicked| T[Insert row with randomUUID id\nagentId set for builtins]
    end
Loading

Comments Outside Diff (1)

  1. apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx, line 152-156 (link)

    P1 The ImportRow still passes preset.name (the raw v1 key, e.g. "claude") as the primary label. After this PR, builtin presets are imported with the display label from AGENT_LABELS (e.g. "Claude Code"), so the list shows "claude" but the imported row lands in v2 as "Claude Code". Passing v2Name here keeps the two in sync.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx
    Line: 152-156
    
    Comment:
    The `ImportRow` still passes `preset.name` (the raw v1 key, e.g. `"claude"`) as the `primary` label. After this PR, builtin presets are imported with the display label from `AGENT_LABELS` (e.g. `"Claude Code"`), so the list shows `"claude"` but the imported row lands in v2 as `"Claude Code"`. Passing `v2Name` here keeps the two in sync.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx:152-156
The `ImportRow` still passes `preset.name` (the raw v1 key, e.g. `"claude"`) as the `primary` label. After this PR, builtin presets are imported with the display label from `AGENT_LABELS` (e.g. `"Claude Code"`), so the list shows `"claude"` but the imported row lands in v2 as `"Claude Code"`. Passing `v2Name` here keeps the two in sync.

```suggestion
	return (
		<ImportRow
			icon={<LuTerminal className="size-3.5" strokeWidth={2} />}
			primary={v2Name}
			secondary={preset.description ?? preset.commands[0]}
```

### Issue 2 of 2
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx:36-38
**Name-based dedup collides with builtin display labels**

`importedNames` is built from all v2 preset names, including builtins imported under their display labels (e.g. `"Claude Code"`). If a user has a custom v1 preset whose name happens to match a builtin's display label, `importedNames.has(v2Name)` returns `true` and the row is permanently stuck as "Imported" — even though no custom preset with that name was ever actually imported. Narrowing `importedNames` to only presets where `agentId` is absent would avoid the collision.

Reviews (1): Last reviewed commit: "feat(desktop): add v1 import intro page ..." | Re-trigger Greptile

Comment on lines +36 to 38
const importedNames = useMemo(
() => new Set(v2Presets.map((p) => p.name)),
[v2Presets],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Name-based dedup collides with builtin display labels

importedNames is built from all v2 preset names, including builtins imported under their display labels (e.g. "Claude Code"). If a user has a custom v1 preset whose name happens to match a builtin's display label, importedNames.has(v2Name) returns true and the row is permanently stuck as "Imported" — even though no custom preset with that name was ever actually imported. Narrowing importedNames to only presets where agentId is absent would avoid the collision.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx
Line: 36-38

Comment:
**Name-based dedup collides with builtin display labels**

`importedNames` is built from all v2 preset names, including builtins imported under their display labels (e.g. `"Claude Code"`). If a user has a custom v1 preset whose name happens to match a builtin's display label, `importedNames.has(v2Name)` returns `true` and the row is permanently stuck as "Imported" — even though no custom preset with that name was ever actually imported. Narrowing `importedNames` to only presets where `agentId` is absent would avoid the collision.

How can I resolve this? If you propose a fix, please make it concise.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eb962682-4b3d-47d9-8258-885f17aeb76f

📥 Commits

Reviewing files that changed from the base of the PR and between a07e446 and e20b4e2.

📒 Files selected for processing (6)
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/V1ImportModal.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/IntroPage/IntroPage.tsx
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/IntroPage/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/WelcomePage/WelcomePage.tsx
  • apps/desktop/src/renderer/stores/v1-import-modal.ts
💤 Files with no reviewable changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/WelcomePage/WelcomePage.tsx

📝 Walkthrough

Walkthrough

This PR enhances the V1 import modal by introducing an introductory onboarding step between the welcome and import pages, refactoring preset import status tracking with memoized sets, and updating the preset row rendering to compute and display agent-linked names alongside import status derivation.

Changes

V1 Import Modal Flow Enhancement

Layer / File(s) Summary
Type & Store Updates
apps/desktop/src/renderer/stores/v1-import-modal.ts
V1ImportPage type union adds "intro" page; V1_IMPORT_PAGE_ORDER inserts "intro" immediately after "welcome".
IntroPage Component
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/IntroPage/*
New IntroPage component exports title "Let's get you started" and explanatory text about workspace/project porting and terminal session handling; index file provides re-export.
Modal Navigation & Rendering
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/V1ImportModal.tsx
Modal imports IntroPage and updates DialogTitle/DialogDescription to differentiate between welcome, intro, and other import pages; conditional rendering added for IntroPage in page switch.
WelcomePage Content
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/components/WelcomePage/WelcomePage.tsx
Descriptive paragraph removed below "Welcome to Superset v2" heading.
Preset Import Status & Display Logic
apps/desktop/src/renderer/routes/_authenticated/components/V1ImportModal/ImportPresetsPage/ImportPresetsPage.tsx
Memoized sets created to track already-imported linked agent IDs and preset names; preset row rendering now derives linkedAgentId (matching preset name to built-in agents), v2Name (from AGENT_LABELS or preset name), and alreadyImported status; PresetRow props updated to accept linkedAgentId and v2Name instead of alreadyImported; inserted V2TerminalPresetRow generated with UUID id and v2Name; UI primary label changed from preset.name to v2Name.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A modal's journey grows more clear,
With intro steps and presets dear,
Agent names now linked with care,
Import flows through every layer fair,
Welcome, intro, then we're there! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately summarizes the main changes: adding an intro page to the v1 import flow and fixing preset import issues for builtin agents.
Description check ✅ Passed Description includes all required sections: clear summary of changes, related issues, type of change (new feature + bug fix), testing steps, and additional context from cubic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-v2-interstitial-page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ImportRow showed the raw v1 key ("claude") while the imported v2 row
landed under the display label ("Claude Code"). Pass v2Name so the picker
matches the post-import name.

importedNames also now excludes builtin-linked v2 rows so a custom v1
preset whose name happens to match a builtin display label isn't falsely
flagged as already imported.
@saddlepaddle saddlepaddle merged commit 1cc8182 into main May 6, 2026
10 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

MocA-Love pushed a commit to MocA-Love/superset that referenced this pull request May 8, 2026
…-sh#4151)

* feat(desktop): add v1 import intro page + fix preset import

Splits the v1 import welcome screen into two pages: the existing
"Welcome to Superset v2" hero (now copy-free) and a new intro page that
sets expectations — workspaces and projects port over, terminal sessions
don't, and v1 stays accessible.

Also fixes the preset import flow, which threw "Invalid input - path: id"
for builtin agent presets ("claude", "codex"). v1 stores those with the
agent name as the preset id, but v2's schema requires id to be a UUID.
The import now generates a fresh UUID for the v2 row, sets agentId for
the link, and dedups on agentId (builtins) or name (custom presets)
instead of v1's id.

* fix(desktop): align import row label with imported name + tighten dedup

ImportRow showed the raw v1 key ("claude") while the imported v2 row
landed under the display label ("Claude Code"). Pass v2Name so the picker
matches the post-import name.

importedNames also now excludes builtin-linked v2 rows so a custom v1
preset whose name happens to match a builtin display label isn't falsely
flagged as already imported.
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