Skip to content

Conversation

@RohitR311
Copy link
Collaborator

@RohitR311 RohitR311 commented Nov 10, 2025

What this PR does?

  1. Fixes the output preview issue occurring mid capture text action.
  2. Fixes the issue wherein the output preview does not automatically open if capture performed the second time immediately after discard operation.
Screenshot 2025-11-10 at 10 02 59 AM

Summary by CodeRabbit

  • Bug Fixes
    • Fixed preview drawer behavior to properly handle empty data states and prevent unexpected opening/closing sequences.
    • Improved display logic for the no-selection message to account for available preview data and tabs, ensuring the message only appears when appropriate.

@RohitR311 RohitR311 added the Type: Bug Something isn't working label Nov 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

Modified InterpretationLog.tsx to add guards resetting data-length tracking when data arrays become empty across Lists, Texts, and Screenshots branches, and tightened the no-selection render condition to also check showPreviewData and availableTabs.length.

Changes

Cohort / File(s) Summary
State Management & Conditional Rendering
src/components/run/InterpretationLog.tsx
Added guards to reset last data length to 0 when Lists, Texts, or Screenshots data arrays become empty while corresponding hasScrape conditions are true; tightened no-selection state render condition to also require showPreviewData === false and availableTabs.length === 0

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Single file with localized, repetitive guard logic across three branches
  • Straightforward conditional refinements with no structural changes

Possibly related PRs

Suggested labels

Scope: UI/UX

Suggested reviewers

  • amhsirak

Poem

🐰 The guards stand watch, resetting lengths to naught,
When data disappears and empty states are caught,
No tabs to show, no preview in sight,
The drawer rests gently, tucked out of sight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: output preview for capture text action' directly relates to the main changes in InterpretationLog.tsx, which fix output preview issues for capture text actions by adjusting preview drawer opening logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch preview-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 653a332 and 141316d.

📒 Files selected for processing (1)
  • src/components/run/InterpretationLog.tsx (4 hunks)
🔇 Additional comments (2)
src/components/run/InterpretationLog.tsx (2)

309-310: LGTM! Guards properly handle discard-then-recapture scenario.

These guards correctly reset the data-length tracking when data arrays become empty (after a discard), enabling the preview drawer to reopen automatically on the next capture. The parallel structure across all three action types (Lists, Texts, Screenshots) maintains consistency.

Also applies to: 320-321, 331-332


475-475: Good fix - prevents "no selection" from showing when data exists.

The tightened condition correctly prevents the "no selection" message from rendering when there's preview data or available tabs, addressing the mid-capture preview issue mentioned in the PR.

Note: On line 287, getAvailableTabs includes showPreviewData in its dependency array but doesn't actually use it. Since both showPreviewData and availableTabs.length are derived from the data arrays, they should remain in sync, but this pre-existing inconsistency could be cleaned up in a future refactor.


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.

@RohitR311 RohitR311 added the Scope: Recorder All issues/PRs related to recorder label Nov 10, 2025
@amhsirak amhsirak merged commit 2b85a04 into develop Nov 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Recorder All issues/PRs related to recorder Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants