[PR #1711] [MERGED] [codex] Lazy-load startup shell paths #5226

Closed
opened 2026-10-22 04:14:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1711
Author: @Xelvanis
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @SpicyMarinara

Base: refactor ← Head: codex/lazy-load-startup-shell


📝 Commits (1)

  • 6adc573 Lazy-load startup shell paths

📊 Changes

23 files changed (+658 additions, -471 deletions)

View changed files

📝 package.json (+4 -2)
📝 src/app/shell/AppShell.tsx (+50 -9)
📝 src/app/shell/ChatSidebar.tsx (+2 -2)
📝 src/app/shell/WindowTitleBar.tsx (+8 -3)
📝 src/app/shell/useStartNewChat.ts (+1 -1)
➕ src/features/catalog/agents/debug-shell.ts (+1 -0)
➕ src/features/catalog/chats/autonomous-unread.ts (+1 -0)
➕ src/features/catalog/chats/hooks/chat-cache.ts (+77 -0)
➕ src/features/catalog/chats/hooks/use-bulk-export-chats.ts (+68 -0)
📝 src/features/catalog/chats/hooks/use-chat-folders.ts (+1 -1)
➕ src/features/catalog/chats/hooks/use-chat-lifecycle.ts (+210 -0)
➕ src/features/catalog/chats/hooks/use-chat-summaries.ts (+77 -0)
📝 src/features/catalog/chats/hooks/use-chats.test.tsx (+38 -1)
📝 src/features/catalog/chats/hooks/use-chats.ts (+14 -436)
➕ src/features/catalog/chats/hooks/use-clear-autonomous-unread.ts (+18 -0)
➕ src/features/catalog/chats/lib/download.ts (+13 -0)
➕ src/features/catalog/chats/sidebar.ts (+12 -0)
➕ src/features/modes/conversation/background-autonomous.ts (+1 -0)
📝 src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts (+1 -1)
📝 src/features/shell/notifications/components/ChatNotificationBubbles.tsx (+1 -4)

...and 3 more files

📄 Description

Linked issue

#1712

Why this change

  • Reduce startup bundle work by deferring optional shell surfaces and heavyweight chat-sidebar-only hooks until they are actually needed.

What changed

  • Lazy-load optional AppShell surfaces: Professor Mari, chat notification bubbles, agent debug, Spotify widgets, and image prompt review modal.
  • Move chat sidebar hooks into smaller public entrypoints so AppShell/ChatSidebar do not pull all chat runtime hooks into startup.
  • Dynamically import background autonomous generation only when an inactive autonomous chat actually triggers.
  • Keep agent debug activity from re-rendering AppShell while debug mode is disabled.

Refactor impact

Primary owner:

App shell and catalog chat hooks.

Impact areas reviewed:

  • AppShell startup imports and optional surface gates.
  • Chat sidebar hook entrypoints and compatibility exports from features/catalog/chats.
  • Conversation background autonomous import timing.
  • Image prompt review modal lifecycle.

Boundary notes:

  • UI changes stay in src/app and src/features.
  • No engine, shared API, Rust command, or remote runtime behavior changes.
  • New feature entrypoints expose existing hooks without adding raw Tauri or HTTP calls.

Pressure points touched:

  • AppShell startup composition.
  • Broad use-chats hook file was split into focused chat hook modules.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Ran:

  • pnpm typecheck
  • pnpm check:architecture
  • pnpm build
  • pnpm test src/features/catalog/chats/hooks/use-chats.test.tsx
  • pnpm test:ui:run
  • git diff --check

Browser smoke passed through Playwright. Native Tauri manual QA was not run.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes included; this is internal startup-loading structure.

UI evidence

No screenshot or recording added; this changes loading boundaries, not intended visuals.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added bulk export functionality for chats in multiple formats.
  • Performance

    • Improved performance through lazy-loading of non-essential UI components, including chat notifications, debug panel, and media player widgets.
    • UI elements now render conditionally only when needed, reducing initial load time.
  • Refactor

    • Reorganized internal chat management modules for better code maintainability.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1711 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `refactor` ← **Head:** `codex/lazy-load-startup-shell` --- ### 📝 Commits (1) - [`6adc573`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6adc57313150c3125f8e097b0b98952201aadc6f) Lazy-load startup shell paths ### 📊 Changes **23 files changed** (+658 additions, -471 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+4 -2) 📝 `src/app/shell/AppShell.tsx` (+50 -9) 📝 `src/app/shell/ChatSidebar.tsx` (+2 -2) 📝 `src/app/shell/WindowTitleBar.tsx` (+8 -3) 📝 `src/app/shell/useStartNewChat.ts` (+1 -1) ➕ `src/features/catalog/agents/debug-shell.ts` (+1 -0) ➕ `src/features/catalog/chats/autonomous-unread.ts` (+1 -0) ➕ `src/features/catalog/chats/hooks/chat-cache.ts` (+77 -0) ➕ `src/features/catalog/chats/hooks/use-bulk-export-chats.ts` (+68 -0) 📝 `src/features/catalog/chats/hooks/use-chat-folders.ts` (+1 -1) ➕ `src/features/catalog/chats/hooks/use-chat-lifecycle.ts` (+210 -0) ➕ `src/features/catalog/chats/hooks/use-chat-summaries.ts` (+77 -0) 📝 `src/features/catalog/chats/hooks/use-chats.test.tsx` (+38 -1) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+14 -436) ➕ `src/features/catalog/chats/hooks/use-clear-autonomous-unread.ts` (+18 -0) ➕ `src/features/catalog/chats/lib/download.ts` (+13 -0) ➕ `src/features/catalog/chats/sidebar.ts` (+12 -0) ➕ `src/features/modes/conversation/background-autonomous.ts` (+1 -0) 📝 `src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts` (+1 -1) 📝 `src/features/shell/notifications/components/ChatNotificationBubbles.tsx` (+1 -4) _...and 3 more files_ </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue #1712 ## Why this change - Reduce startup bundle work by deferring optional shell surfaces and heavyweight chat-sidebar-only hooks until they are actually needed. ## What changed - Lazy-load optional AppShell surfaces: Professor Mari, chat notification bubbles, agent debug, Spotify widgets, and image prompt review modal. - Move chat sidebar hooks into smaller public entrypoints so AppShell/ChatSidebar do not pull all chat runtime hooks into startup. - Dynamically import background autonomous generation only when an inactive autonomous chat actually triggers. - Keep agent debug activity from re-rendering AppShell while debug mode is disabled. ## Refactor impact Primary owner: App shell and catalog chat hooks. Impact areas reviewed: - AppShell startup imports and optional surface gates. - Chat sidebar hook entrypoints and compatibility exports from `features/catalog/chats`. - Conversation background autonomous import timing. - Image prompt review modal lifecycle. Boundary notes: - UI changes stay in `src/app` and `src/features`. - No engine, shared API, Rust command, or remote runtime behavior changes. - New feature entrypoints expose existing hooks without adding raw Tauri or HTTP calls. Pressure points touched: - AppShell startup composition. - Broad `use-chats` hook file was split into focused chat hook modules. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Ran: - `pnpm typecheck` - `pnpm check:architecture` - `pnpm build` - `pnpm test src/features/catalog/chats/hooks/use-chats.test.tsx` - `pnpm test:ui:run` - `git diff --check` Browser smoke passed through Playwright. Native Tauri manual QA was not run. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes included; this is internal startup-loading structure. ## UI evidence No screenshot or recording added; this changes loading boundaries, not intended visuals. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added bulk export functionality for chats in multiple formats. * **Performance** * Improved performance through lazy-loading of non-essential UI components, including chat notifications, debug panel, and media player widgets. * UI elements now render conditionally only when needed, reducing initial load time. * **Refactor** * Reorganized internal chat management modules for better code maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5226
No description provided.