Skip to content

feat(debug): add splash previews - #2051

Merged
zhangmo8 merged 11 commits into
devfrom
feat/splash-debug-previews
Jul 28, 2026
Merged

feat(debug): add splash previews#2051
zhangmo8 merged 11 commits into
devfrom
feat/splash-debug-previews

Conversation

@zhangmo8

@zhangmo8 zhangmo8 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add development-only Splash scenario controls for loading, system credential unlock, and disabled manual password unlock states
  • route controls through typed, main-process-gated commands and a scoped one-way Splash preload event
  • replay preview state safely for Vue and inline fallback Splash renderers without affecting real database-unlock ownership
  • add focused boundary, lifecycle, fallback, renderer, and Debug Settings regression coverage
  • retain normal build-generated ACP and provider catalog snapshot refreshes

UI layout

BEFORE

Settings › Debug
└─ onboarding / mock chat / mock update controls

AFTER

Settings › Debug
├─ onboarding / mock chat / mock update controls
└─ Splash previews
   ├─ [Loading]
   ├─ [System credential unlock]
   ├─ [Manual password unlock]
   └─ [Close preview]

Safety

  • controls stay development-only and the main typed routes reject production or packaged calls
  • manual-unlock preview disables password submission/cancellation and never changes a real unlock request

Validation

  • pnpm run format:check
  • pnpm run i18n
  • pnpm run lint
  • pnpm run architecture:renderer-baseline:check
  • pnpm run icons:check
  • pnpm run typecheck
  • pnpm run test:main — 5,370 passed, 277 skipped
  • pnpm run test:renderer — 1,625 passed
  • pnpm run build

Summary by CodeRabbit

  • New Features
    • Added development-only splash preview scenarios (loading, system unlock, preview-only unlock) with new open/close controls in Debug settings.
    • Preview UI is synchronized to the splash/renderer and disables password submission/quit actions; splash preview now uses transparent styling.
  • Documentation
    • Added “Splash Debug Tooling” specification covering preview modes and safety constraints.
  • Maintenance
    • Updated the Dimcode agent to version 0.2.37.
  • Model Updates
    • Expanded and refined the model/provider catalog (new entries and updated metadata/pricing).
  • Tests
    • Added/updated coverage for debug routes, IPC/preload replay, preview safety, and splash/DebugSettings UI + i18n.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds development-only splash scenario previews across typed routes, main-process lifecycle, preload IPC, Vue and fallback renderers, and Debug settings. It also updates provider model metadata and bumps the dimcode registry package from 0.2.36 to 0.2.37.

Changes

Splash debug tooling

Layer / File(s) Summary
Typed contracts and route registration
src/shared/contracts/splash.ts, src/shared/contracts/routes/*
Defines valid splash modes and typed show/close routes in the shared catalog.
Main-process lifecycle and fallback renderer
src/main/app/*, src/main/app/splashWindow.ts, src/renderer/splash/index.html
Wires SplashWindow into gated routes, dispatches debug modes after load, preserves unlock requests when closing previews, and enables transparent splash rendering.
Preload and Vue renderer behavior
src/preload/splash-preload.ts, src/renderer/splash/*
Adds cached debug-mode IPC and disables unlock interactions during preview states.
Debug settings controls
src/renderer/api/DebugClient.ts, src/renderer/settings/components/DebugSettings.vue
Adds scenario buttons and close handling with loading guards, response checks, and error feedback.
Specification and tests
docs/features/splash-debug-tooling/spec.md, test/main/app/*, test/renderer/*, src/renderer/src/i18n/*
Documents the contracts and validates routing, replay, renderer state, safety behavior, controls, bootstrap direction, and localized preview messaging.

Model catalog updates

Layer / File(s) Summary
Provider model metadata
resources/model-db/providers.json
Adds the Hyper provider and numerous chat, multimodal, audio, video, embedding, OCR, and legacy model entries while revising capabilities, limits, identifiers, dates, and pricing.

Agent registry update

Layer / File(s) Summary
dimcode package version
resources/acp-registry/registry.json
Updates the registered agent and npx package from 0.2.36 to 0.2.37.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DebugSettings
  participant DebugClient
  participant MainProcess
  participant SplashWindow
  participant Preload
  participant SplashRenderer
  DebugSettings->>DebugClient: showSplashScenario(mode)
  DebugClient->>MainProcess: invoke typed debug route
  MainProcess->>SplashWindow: showDebugScenario(mode)
  SplashWindow->>Preload: send debug mode IPC
  Preload->>SplashRenderer: replay or deliver mode
  SplashRenderer->>SplashRenderer: disable preview unlock actions
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding development-only splash preview controls under debug.
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.
✨ 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 feat/splash-debug-previews

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/renderer/settings/components/DebugSettings.vue (1)

99-103: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Splash scenario labels won't update on locale change.

splashScenarios calls t(...) once at setup-time and stores plain strings, so the button labels won't react if the user switches locale while this page is mounted — unlike every other translated string in this file, which is re-evaluated live (inline in template or inside click handlers). Wrap it in computed() so labels stay in sync with t().

🌐 Proposed fix
-const splashScenarios: Array<{ mode: SplashDebugMode; label: string }> = [
-  { mode: 'loading', label: t('settings.debug.splash.loading') },
-  { mode: 'system-unlock', label: t('settings.debug.splash.systemUnlock') },
-  { mode: 'unlock', label: t('settings.debug.splash.unlock') }
-]
+const splashScenarios = computed<Array<{ mode: SplashDebugMode; label: string }>>(() => [
+  { mode: 'loading', label: t('settings.debug.splash.loading') },
+  { mode: 'system-unlock', label: t('settings.debug.splash.systemUnlock') },
+  { mode: 'unlock', label: t('settings.debug.splash.unlock') }
+])

(also add computed to the import { onMounted, ref } from 'vue' line)

As per path instructions, "Use vue-i18n for user-facing copy" for src/renderer/**/*.{vue,ts,tsx}.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/settings/components/DebugSettings.vue` around lines 99 - 103,
Update splashScenarios to be a computed value so its labels re-evaluate through
t() when the locale changes, while preserving the existing scenario modes and
translation keys. Add computed to the Vue imports and update consumers to use
the computed result as needed.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/renderer/splash/loading.vue`:
- Around line 46-50: Update the unlock-hint rendering in the loading component
so the isDebugPreview branch uses an existing vue-i18n message via t/$t instead
of hardcoded text. Add the preview hint to the established i18n messages and
preserve unlockHint for the non-preview branch.

In `@test/renderer/splash/loading.test.ts`:
- Around line 70-81: Extend the existing development-preview test around
debugModeListener('unlock') to assert the secondary Quit/cancel button is
disabled, then trigger its cancellation action and verify window.deepchatSplash
does not receive a cancellation request. Keep the regression coverage limited to
this disabled cancellation contract alongside the existing submission assertion.

---

Nitpick comments:
In `@src/renderer/settings/components/DebugSettings.vue`:
- Around line 99-103: Update splashScenarios to be a computed value so its
labels re-evaluate through t() when the locale changes, while preserving the
existing scenario modes and translation keys. Add computed to the Vue imports
and update consumers to use the computed result as needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: def819f0-5962-45f5-a0f3-6a5d92c364ed

📥 Commits

Reviewing files that changed from the base of the PR and between 082edea and f937087.

📒 Files selected for processing (20)
  • docs/features/splash-debug-tooling/spec.md
  • resources/acp-registry/registry.json
  • resources/model-db/providers.json
  • src/main/app/composition.ts
  • src/main/app/mainProcess.ts
  • src/main/app/routes.ts
  • src/main/app/splashWindow.ts
  • src/preload/splash-preload.ts
  • src/renderer/api/DebugClient.ts
  • src/renderer/settings/components/DebugSettings.vue
  • src/renderer/splash/env.d.ts
  • src/renderer/splash/loading.vue
  • src/shared/contracts/routes.ts
  • src/shared/contracts/routes/debug.routes.ts
  • src/shared/contracts/splash.ts
  • test/main/app/routes.test.ts
  • test/main/app/splashWindow.display.test.ts
  • test/renderer/api/preloadBoundaries.test.ts
  • test/renderer/components/DebugSettings.test.ts
  • test/renderer/splash/loading.test.ts

Comment thread src/renderer/splash/loading.vue
Comment thread test/renderer/splash/loading.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/main/app/splashWindow.display.test.ts (1)

139-148: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use scoped DOM/style assertions for both transparency checks.

Both tests validate CSS through broad source-string matching, so they can miss incorrectly scoped rules or fail on harmless formatting changes.

  • test/main/app/splashWindow.display.test.ts#L139-L148: assert the primary document’s body style/rule directly.
  • test/main/app/splashWindow.display.test.ts#L399-L402: assert the fallback root style through JSDOM while separately preserving the manual-unlock shell’s dark-background contract.

As per coding guidelines, tests should focus on observable contracts and remove checks that only test implementation internals before handoff.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/main/app/splashWindow.display.test.ts` around lines 139 - 148, Replace
the broad source-string checks in
test/main/app/splashWindow.display.test.ts:139-148 with a scoped DOM/style
assertion against the primary document body, verifying its background is
transparent. At test/main/app/splashWindow.display.test.ts:399-402, assert the
fallback root background through JSDOM and separately preserve the manual-unlock
shell’s dark-background contract; avoid formatting-sensitive raw source matching
at both sites.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/main/app/splashWindow.display.test.ts`:
- Around line 139-148: Replace the broad source-string checks in
test/main/app/splashWindow.display.test.ts:139-148 with a scoped DOM/style
assertion against the primary document body, verifying its background is
transparent. At test/main/app/splashWindow.display.test.ts:399-402, assert the
fallback root background through JSDOM and separately preserve the manual-unlock
shell’s dark-background contract; avoid formatting-sensitive raw source matching
at both sites.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e167bc35-0e5d-4afe-80cd-58f7a2440cad

📥 Commits

Reviewing files that changed from the base of the PR and between f937087 and 9ca5583.

📒 Files selected for processing (4)
  • docs/features/splash-debug-tooling/spec.md
  • src/main/app/splashWindow.ts
  • src/renderer/splash/index.html
  • test/main/app/splashWindow.display.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/features/splash-debug-tooling/spec.md
  • src/main/app/splashWindow.ts

@zhangmo8

Copy link
Copy Markdown
Collaborator Author

Addressed the three actionable review items in 41d86a4:\n\n- localized the splash preview hint and bootstrapped the splash renderer with the typed locale bridge;\n- covered disabled Quit/cancel behavior in the splash preview regression test;\n- made splash scenario labels reactive to locale changes, with focused regression coverage.\n\nVerified with format, i18n, lint, full typecheck, and the focused renderer tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/renderer/splash/main.ts`:
- Around line 7-9: Update the splash initialization around createRendererI18n to
capture its returned languageState, then set document.documentElement.dir to
"rtl" for RTL state and "auto" otherwise before mounting the splash app.
Preserve the existing i18n setup and ensure the direction is applied before
mount.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e08cd9a-efb8-4658-bca1-3ad6e62c5896

📥 Commits

Reviewing files that changed from the base of the PR and between 9ca5583 and 41d86a4.

📒 Files selected for processing (28)
  • src/preload/splash-preload.ts
  • src/renderer/settings/components/DebugSettings.vue
  • src/renderer/splash/env.d.ts
  • src/renderer/splash/loading.vue
  • src/renderer/splash/main.ts
  • src/renderer/src/i18n/da-DK/settings.json
  • src/renderer/src/i18n/de-DE/settings.json
  • src/renderer/src/i18n/en-US/settings.json
  • src/renderer/src/i18n/es-ES/settings.json
  • src/renderer/src/i18n/fa-IR/settings.json
  • src/renderer/src/i18n/fr-FR/settings.json
  • src/renderer/src/i18n/he-IL/settings.json
  • src/renderer/src/i18n/id-ID/settings.json
  • src/renderer/src/i18n/it-IT/settings.json
  • src/renderer/src/i18n/ja-JP/settings.json
  • src/renderer/src/i18n/ko-KR/settings.json
  • src/renderer/src/i18n/ms-MY/settings.json
  • src/renderer/src/i18n/pl-PL/settings.json
  • src/renderer/src/i18n/pt-BR/settings.json
  • src/renderer/src/i18n/ru-RU/settings.json
  • src/renderer/src/i18n/tr-TR/settings.json
  • src/renderer/src/i18n/vi-VN/settings.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • test/renderer/api/preloadBoundaries.test.ts
  • test/renderer/components/DebugSettings.test.ts
  • test/renderer/splash/loading.test.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/renderer/settings/components/DebugSettings.vue
  • src/preload/splash-preload.ts
  • src/renderer/splash/env.d.ts
  • test/renderer/splash/loading.test.ts
  • test/renderer/components/DebugSettings.test.ts
  • test/renderer/api/preloadBoundaries.test.ts
  • src/renderer/splash/loading.vue

Comment thread src/renderer/splash/main.ts Outdated
@zhangmo8

zhangmo8 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the RTL-direction finding in 5f0b600: splash bootstrap now applies the returned languageState direction to document.documentElement.dir before mounting. Added focused RTL and non-RTL bootstrap tests; focused splash tests, web typecheck, and lint pass.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/renderer/splash/main.test.ts`:
- Around line 24-26: Update the mount mock setup in the splash bootstrap tests
to capture document.documentElement.dir at the moment mount is invoked, then
assert that captured value rather than the final document direction in both RTL
and non-RTL cases. Keep the existing mount-call assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b96407e7-e6a1-4c5f-bf24-558614a110a0

📥 Commits

Reviewing files that changed from the base of the PR and between 41d86a4 and 5f0b600.

📒 Files selected for processing (2)
  • src/renderer/splash/main.ts
  • test/renderer/splash/main.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/splash/main.ts

Comment thread test/renderer/splash/main.test.ts
@zhangmo8
zhangmo8 merged commit b336478 into dev Jul 28, 2026
12 checks passed
@zhangmo8
zhangmo8 deleted the feat/splash-debug-previews branch July 28, 2026 08:41
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