Skip to content

perf(search): memoize active-result lookup - #1504

Draft
seonghobae wants to merge 8 commits into
developfrom
bolt-optimize-search-layout-477240424295171920
Draft

perf(search): memoize active-result lookup#1504
seonghobae wants to merge 8 commits into
developfrom
bolt-optimize-search-layout-477240424295171920

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Current authority

  • Base: develop@042b0c70531b229af3acbd0421a2f23098d848b3
  • Exact head: 9191ea02b69c08a1b12af36e4a825d5c5869b8e3
  • Child lane: Draft perf(search): replace repeated result scans with indexed lookups #1477 exact head d3687248894a1427f6614c186a963849ba7ac215
  • Lifecycle: Draft until current-head gates establish whether the child fully supersedes this parent delta.

Scope

Memoize the activeResult lookup so unrelated component state changes do not re-run the linear filteredResults.find(...). The focused regression instruments result-shaped .find() calls and verifies that an unrelated input-state rerender does not increase the active-result lookup count. This establishes the local recalculation contract; it is not an end-to-end latency or p95 measurement.

The branch-local .jules/bolt.md learning delta was removed at 9191ea02b69c08a1b12af36e4a825d5c5869b8e3; product changes remain in SearchLayout.tsx and SearchLayout.test.tsx only.

Stack ownership

#1477 is the explicit child of this PR, not a parallel direct-develop writer. Its current exact head d3687248894a1427f6614c186a963849ba7ac215 is ahead-only / behind 0 from this exact parent and its effective child delta is limited to the same two SearchLayout source/test files.

The child now contains source/test repair for the previously valid duplicate-id semantic regression: its index preserves the first occurrence of a duplicate id, matching this parent's former find/findIndex first-match semantics, while retaining this parent's unrelated-input regression intent through ancestry. The current child review thread for that finding is resolved after exact-head verification.

Evidence and owner path

Do not treat source-level succession as merge-ready evidence. #1477 currently has zero repository-owned PR workflow runs on its current exact head and no qualifying independent post-last-push approval. The stacked-base workflow activation defect is owned by canonical Naruon PR #1562 codex/stacked-pr-workflow-triggers@bc91b36dec70c14e0cde526e2330638f5e0ce352, itself Draft behind prerequisite #1531; do not duplicate that CI delta into either SearchLayout branch or manufacture a no-op requeue commit.

This parent therefore stays open and Draft until #1562's repair is protected-integrated and the then-unchanged #1477 head has complete required hosted checks, independent review, and no valid current-head findings. Only then evaluate whether #1477 completely supersedes this parent and can be integrated in normal stack order. No close-by-description, self-approval, force-push, destructive rebase, predecessor-evidence transfer, unsupported p95 claim, or gate weakening.

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: a5f488e6-c3e1-402a-ac34-11d37c341324

📥 Commits

Reviewing files that changed from the base of the PR and between 042b0c7 and 1263f16.

📒 Files selected for processing (3)
  • .jules/bolt.md
  • frontend/src/components/SearchLayout.test.tsx
  • frontend/src/components/SearchLayout.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

SearchLayout now memoizes active-result selection based on filtered results and the selected identifier. A regression test verifies that unrelated input changes do not repeat the lookup. Test cleanup restores Vitest mocks.

Changes

Search result memoization

Layer / File(s) Summary
Memoize and validate active-result selection
frontend/src/components/SearchLayout.tsx, frontend/src/components/SearchLayout.test.tsx, .jules/bolt.md
activeResult uses useMemo with filteredResults and activeResultId dependencies. The regression test tracks lookup counts after unrelated input changes. Test cleanup restores Vitest mocks. The learning note documents the optimization.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1263f

The change memoizes an existing search-result lookup to reduce unnecessary work during rerenders without altering access, data flow, dependencies, or deployment behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: memoizing the active-result lookup in the search component for performance.
✨ 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 bolt-optimize-search-layout-477240424295171920

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.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head a390e521d5caecf5b4d8fc27cc90aaf27b525624; both current-head Devin findings are fixed.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please review exact current head a390e521d5caecf5b4d8fc27cc90aaf27b525624. Merge/update actions remain disabled.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@seonghobae I will review pull request #1504 at commit a390e521d5caecf5b4d8fc27cc90aaf27b525624.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please re-review exact current head f6c76a8571e02d22d35bade75694ab5b0aca3cf0; the performance spy now also restores in the shared test cleanup.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please review exact current head f6c76a8571e02d22d35bade75694ab5b0aca3cf0. Merge/update actions remain disabled.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

@seonghobae I will re-review pull request #1504 at commit f6c76a8571e02d22d35bade75694ab5b0aca3cf0. I will verify the shared cleanup for the performance spy.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@coderabbitai review

Please review exact current head a390e521d5caecf5b4d8fc27cc90aaf27b525624; both current-head Devin findings are fixed.

Acknowledged.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@opencode-agent

Please review exact current head a390e521d5caecf5b4d8fc27cc90aaf27b525624. Merge/update actions remain disabled.

Acknowledged.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@opencode-agent

Please review exact current head f6c76a8571e02d22d35bade75694ab5b0aca3cf0. Merge/update actions remain disabled.

Acknowledged.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@coderabbitai review

Please re-review exact current head f6c76a8571e02d22d35bade75694ab5b0aca3cf0; the performance spy now also restores in the shared test cleanup.

Acknowledged.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

Devin Review

Comment thread frontend/src/components/SearchLayout.tsx
Comment thread frontend/src/components/SearchLayout.tsx
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 1263f166df26668a2edc389adc7079006dc313dd:

  • 2 unresolved current review thread(s) remain.
  • Required check strix is CANCELLED on the current head.

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode could not approve from deterministic current-head evidence because GitHub Checks have failed.

Findings

1. HIGH Current-head GitHub Checks - Fix failed required checks before approval

  • Problem: Failed same-head checks remain for 1263f166df26668a2edc389adc7079006dc313dd.
  • Root cause: The model-unavailable evidence fallback is allowed only when peer GitHub Checks are complete and clean.
  • Fix: Read and fix the failed check logs below, then rerun the current-head checks.
  • Regression test: Keep the model-unavailable fallback gated on an empty failed-check rollup.

Failed checks:

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Repository file: bolt.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Repository file: bolt.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Frontend: SearchLayout.test.tsx (2 files)"]
  S2 --> I2["browser runtime and bundle"]
  I2 --> R2["Review risk: Frontend: SearchLayout.test.tsx (2 files)"]
  R2 --> V2["frontend tests"]
Loading

@opencode-agent

opencode-agent Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

@seonghobae seonghobae changed the title ⚡ Bolt: [성능 개선] SearchLayout 리렌더링 최적화 perf(search): memoize active-result lookup Sep 5, 2026
@seonghobae seonghobae added priority: medium Normal-priority or P2 work status: draft Draft pull request type: maintenance Maintenance, build, dependency, or operational upkeep maintenance labels Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance priority: medium Normal-priority or P2 work status: draft Draft pull request type: maintenance Maintenance, build, dependency, or operational upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant