From 3653c3396db20c9b0295cb995a04d326331f2c16 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Sat, 18 Oct 2025 23:06:38 -0600 Subject: [PATCH 1/2] feat: Add DiscourseContextOverlay support in ResultsTable - 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. --- .../components/results-view/ResultsTable.tsx | 17 +++++++++++++++-- apps/roam/src/utils/predefinedSelections.ts | 3 +++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/roam/src/components/results-view/ResultsTable.tsx b/apps/roam/src/components/results-view/ResultsTable.tsx index fe3237b2b..2427908ba 100644 --- a/apps/roam/src/components/results-view/ResultsTable.tsx +++ b/apps/roam/src/components/results-view/ResultsTable.tsx @@ -24,6 +24,9 @@ import openBlockInSidebar from "roamjs-components/writes/openBlockInSidebar"; import setInputSettings from "roamjs-components/util/setInputSettings"; import toCellValue from "~/utils/toCellValue"; import { ContextContent } from "~/components/DiscourseContext"; +import DiscourseContextOverlay from "~/components/DiscourseContextOverlay"; +import nanoid from "nanoid"; +import { CONTEXT_OVERLAY_SUGGESTION } from "~/utils/predefinedSelections"; const EXTRA_ROW_TYPES = ["context", "discourse"] as const; type ExtraRowType = (typeof EXTRA_ROW_TYPES)[number] | null; @@ -211,7 +214,7 @@ const ResultRow = ({ const cell = (key: string) => { const value = toCellValue({ value: r[`${key}-display`] || r[key] || "", - uid: (r[`${key}-uid`] as string) || "", + uid: r[`${key}-uid`] || "", }); const action = r[`${key}-action`]; if (typeof action === "string") { @@ -219,6 +222,16 @@ const ResultRow = ({ value.toUpperCase().replace(/\s/g, "_") in IconNames ? { icon: value as IconName, minimal: true } : { text: value }; + const actionUid = r[`${key}-uid`]; + + if (action === "discourse" && value === CONTEXT_OVERLAY_SUGGESTION) { + return ( + + ); + } return (