Skip to content

Conversation

@mdroidian
Copy link
Contributor

@mdroidian mdroidian commented Oct 19, 2025

simple v0 with the popup but this is the only way to async query the discourse relations/references to get the values.
action:discourse:overlay
image

Summary by CodeRabbit

  • New Features
    • Introduced an "overlay" suggestion option for discourse-related actions, allowing users to view and interact with context overlays alongside other interaction options.

@linear
Copy link

linear bot commented Oct 19, 2025

@supabase
Copy link

supabase bot commented Oct 19, 2025

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

- Integrated DiscourseContextOverlay to display context suggestions in ResultRow.
- Updated uid handling for actions to ensure proper functionality.
- Introduced CONTEXT_OVERLAY_SUGGESTION constant for better maintainability in predefined selections.
@mdroidian
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 19, 2025

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 19, 2025

📝 Walkthrough

Walkthrough

Added DiscourseContextOverlay rendering logic to ResultsTable component with conditional action-aware rendering. When action type is "discourse" and displayed value matches a new constant, renders DiscourseContextOverlay instead of standard Button. Introduced new CONTEXT_OVERLAY_SUGGESTION constant in predefinedSelections.ts. Updated UID handling to consistently propagate actionUid throughout event payloads.

Changes

Cohort / File(s) Summary
New Constant Definition
apps/roam/src/utils/predefinedSelections.ts
Added new exported constant CONTEXT_OVERLAY_SUGGESTION with value "overlay" to enable discourse-related overlay suggestions.
Action-Aware Rendering
apps/roam/src/components/results-view/ResultsTable.tsx
Added imports for DiscourseContextOverlay, nanoid, and CONTEXT_OVERLAY_SUGGESTION. Implemented conditional rendering logic that detects when action type is "discourse" and displayed value matches CONTEXT_OVERLAY_SUGGESTION, then renders DiscourseContextOverlay component with generated ID and UID. Updated UID handling from type-cast to direct fallback and replaced uid: r[${key}-uid] with uid: actionUid in event payloads for consistent UID propagation.

Sequence Diagram

sequenceDiagram
    participant ResultRow as ResultRow Cell
    participant Logic as Action Logic
    participant Button as Button Component
    participant Overlay as DiscourseContextOverlay
    participant Event as Event Payload

    ResultRow->>Logic: Compute action with uid
    alt action === "discourse" AND value === CONTEXT_OVERLAY_SUGGESTION
        Logic->>Overlay: Render with uid, id: nanoid()
        Overlay->>Event: Dispatch with actionUid
    else
        Logic->>Button: Render standard button
        Button->>Event: Dispatch with actionUid
    end
    Event->>Event: Propagate consistent UID
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes introduce conditional rendering logic with a new component integration in an existing results table component, requiring verification of the action type detection, component prop passing, UID consistency, and event payload handling. The constant definition is trivial, but the overall scope spans logic density and file interactions of moderate complexity.

Possibly related PRs

Pre-merge checks

✅ 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 "ENG-984 Add DiscourseContextOverlay support in ResultsTable" is specific and directly reflects the primary changes in the pull request. The changeset's main modifications are in ResultsTable.tsx, where DiscourseContextOverlay component rendering is introduced with action-aware logic, while the supporting change to predefinedSelections.ts adds the necessary constant. The title clearly identifies both the feature being added (DiscourseContextOverlay support) and the component where it's implemented (ResultsTable), making it easy for a developer scanning version history to understand the purpose of this PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e386761 and 3653c33.

📒 Files selected for processing (2)
  • apps/roam/src/components/results-view/ResultsTable.tsx (3 hunks)
  • apps/roam/src/utils/predefinedSelections.ts (2 hunks)
🔇 Additional comments (2)
apps/roam/src/utils/predefinedSelections.ts (1)

245-245: LGTM! Good use of a named constant.

Extracting the "overlay" string into a named constant improves maintainability and enables consistent usage across files.

Also applies to: 527-527

apps/roam/src/components/results-view/ResultsTable.tsx (1)

243-243: Good refactor: consistent use of extracted variable.

Using actionUid instead of re-accessing r[${key}-uid] improves code clarity and follows the DRY principle.

- Removed unnecessary imports for improved code clarity.
- Simplified uid generation for DiscourseContextOverlay to ensure consistent behavior.
- Updated conditional logic for better readability and maintainability.
@mdroidian mdroidian merged commit 6a76a03 into main Oct 19, 2025
5 checks passed
@mdroidian mdroidian deleted the eng-984-add-v0-discourse-context-to-query-builder-selection branch October 19, 2025 05:21
@github-project-automation github-project-automation bot moved this to Done in General Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants