Skip to content

Perf/lazy load side panel#37

Open
emefienem wants to merge 5 commits into
sabbah13:mainfrom
emefienem:perf/lazy-load-side-panel
Open

Perf/lazy load side panel#37
emefienem wants to merge 5 commits into
sabbah13:mainfrom
emefienem:perf/lazy-load-side-panel

Conversation

@emefienem

Copy link
Copy Markdown
Collaborator

Pull Request

What

Lazy-loads SidePanel with React.lazy + Suspense and memoizes the selected task lookup so the panel's JS bundle is deferred until a card is actually clicked.

Why

On boards with 100+ cards, the side panel was mounting on every board load and running tasks.find() on every 2s poll tick, adding ~150-200ms to first paint. Fixes #30

Type

  • New connector
  • Bug fix
  • Feature / enhancement
  • Documentation
  • Refactor (no behavior change)
  • CI / tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • If this is a connector PR, the contract test harness passes
  • If this is a UI change, I tested in the live artifact (open-board → drag → AI action)
  • CHANGELOG updated under [Unreleased]
  • Conventional commit message (feat:, fix:, docs:, chore:, refactor:)

Screenshots / demo (UI changes only)

Notes for the reviewer

sabbah13 commented May 5, 2026

Copy link
Copy Markdown
Owner

Automated Code Review

Verdict: ⚠️ REQUEST CHANGES

Summary

Defers SidePanel's JS bundle until first card click via React.lazy + Suspense, and moves the inline tasks.find() call into a useMemo so it no longer re-executes on every 2-second poll tick. The core implementation is clean and correct — the named-export lazy pattern is handled properly, the selectedTask memo falls back to selected as expected, and the Suspense fallback preserves the 440px layout width. Two unrelated CHANGELOG mutations (consistent with a dirty rebase) must be reverted before merge.


Issues (must fix before merge)

  1. CHANGELOG corruption [CHANGELOG.md, historical [0.4.8] entry]

    The mcp__<server>__<tool> pattern in the existing release notes has been changed to mcp**<server>**<tool> — the double-underscores were rendered as Markdown bold, garbling the text. This is unrelated to this PR. Please revert this line to its original state.

  2. Unrelated CHANGELOG whitespace change [CHANGELOG.md, [0.4.12] entry]

    A continuation line's indentation was changed from 2 spaces to 5 spaces — also unrelated. Both issues (style: switch palette from cream to native Cowork near-white (RC) #1 and [connector] Add Outlook / Microsoft 365 email connector #2) appear to come from a rebase onto a branch that included other CHANGELOG edits; a rebase onto clean main should resolve them.


Suggestions (optional)

  • Missing blank line after import block [packages/artifact/src/App.tsx] — The blank line after the last import statement was removed when const SidePanel = lazy(...) was inserted. Re-adding it improves readability and avoids a potential import/newline-after-import lint warning.

  • Sparse Suspense fallback — The fallback <aside> is a blank pulsing shell. Since SidePanel has a visible header / body / footer structure, a minimal inner skeleton (title shimmer + a few body-line shimmers) would avoid what could look like a layout bug on a user's first card click. Low priority.

  • No test for the lazy-load path — There is no new test exercising the Suspense fallback or the selectedTask memo. Given the 2s poll frequency, a regression here would be silent. Worth a follow-up issue if not added now.


This review was generated automatically. A maintainer will follow up.


Generated by Claude Code

@emefienem

Copy link
Copy Markdown
Collaborator Author

@sabbah13 i just made those changes

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.

perf: lazy-load card detail panel

2 participants