From 1ba867094a55e24ebdaecea37a7c96b806c51692 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 10:23:30 -0400 Subject: [PATCH 1/8] better box shadow for guide toolbar v2 from krisna --- .../src/modules/guide/components/Toolbar/V2/V2.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx index 651de471e..3b1ef953a 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx @@ -33,6 +33,15 @@ const TOGGLE_COLLAPSED_HOTKEY = "."; const TOOLBAR_WIDTH = "540px"; +const TOOLBAR_BOX_SHADOW = [ + "0 0 0 1px rgba(0, 0, 0, 0.06)", + "0 0 0 1px rgba(255, 255, 255, 0.10)", + "inset 0 1px 0 rgba(255, 255, 255, 0.04)", + "0 1px 1px 0 rgba(0, 0, 0, 0.04)", + "0 4px 6px -1px rgba(0, 0, 0, 0.05)", + "0 8px 16px -4px rgba(0, 0, 0, 0.06)", +].join(", "); + const Kbd = ({ children }: { children: React.ReactNode }) => { return ( { direction="column" backgroundColor="surface-1" rounded="4" - border="px" overflow="hidden" style={{ width: TOOLBAR_WIDTH, - boxShadow: "0 8px 32px var(--tgph-gray-5)", + boxShadow: TOOLBAR_BOX_SHADOW, animation: "toolbar-expand-fade-in 150ms ease-out", }} > From 34e1fde0e661833faeaf4f1140583213edcfde92 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 14:01:17 -0400 Subject: [PATCH 2/8] tooltip copy and delay updates --- .../guide/components/Toolbar/V2/FocusChin.tsx | 7 +- .../Toolbar/V2/GuideAnnotatedStatusDot.tsx | 4 +- .../Toolbar/V2/GuideContextDetails.tsx | 20 ++++-- .../guide/components/Toolbar/V2/GuideRow.tsx | 6 +- .../components/Toolbar/V2/GuideRowDetails.tsx | 66 +++++++++++-------- .../guide/components/Toolbar/V2/V2.tsx | 13 ++-- .../guide/components/Toolbar/V2/helpers.ts | 4 ++ 7 files changed, 76 insertions(+), 44 deletions(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/FocusChin.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/FocusChin.tsx index 337239604..a043433a6 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/FocusChin.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/FocusChin.tsx @@ -7,6 +7,7 @@ import { ChevronLeft, ChevronRight, X } from "lucide-react"; import * as React from "react"; import { GUIDE_ROW_DATA_SELECTOR } from "./GuideRow"; +import { sharedTooltipProps } from "./helpers"; import { InspectionResultOk } from "./useInspectGuideClientStore"; // Extra scroll overshoot so the focused guide plus ~1-2 neighbors are visible, @@ -88,7 +89,7 @@ export const FocusChin = ({ guides, guideListRef }: Props) => { Focus mode: {currentKey} - + - + - + Focus + From c15bae0ad811cf920f93a371f547e724c01a3a25 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 14:50:35 -0400 Subject: [PATCH 4/8] update empty state message --- .../guide/components/Toolbar/V2/V2.tsx | 22 +++++++++++-------- .../guide/components/Toolbar/V2/helpers.ts | 6 +---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx index 3abbeb8cf..dd3b2bc0f 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/V2.tsx @@ -63,18 +63,23 @@ const Kbd = ({ children }: { children: React.ReactNode }) => { ); }; +const getEmptyStateMessage = (displayOption: DisplayOption) => { + switch (displayOption) { + case "all-guides": + return "You have no guides. Get started by creating a guide."; + case "only-active": + return "There are no active guides."; + case "only-eligible": + return "Your current user is not eligible for any guides."; + } +}; + const filterGuides = ( guides: InspectionResultOk["guides"], displayOption: DisplayOption, ) => { return guides.filter((guide) => { - const { isEligible, isQualified } = guide.annotation; - const isDisplayable = isEligible && isQualified; - - if (displayOption === "only-displayable" && !isDisplayable) { - return false; - } - if (displayOption === "only-eligible" && !isEligible) { + if (displayOption === "only-eligible" && !guide.annotation.isEligible) { return false; } if (displayOption === "only-active" && !guide.annotation.active.status) { @@ -308,7 +313,6 @@ export const V2 = () => { > Eligible - {/* Note: `only-displayable` is not available for now */} @@ -393,7 +397,7 @@ export const V2 = () => { ) : guides.length === 0 ? ( - No guides match the current filter. + {getEmptyStateMessage(displayOption)} ) : ( diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/helpers.ts b/packages/react/src/modules/guide/components/Toolbar/V2/helpers.ts index cd13e7c53..c90dc2aee 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/helpers.ts +++ b/packages/react/src/modules/guide/components/Toolbar/V2/helpers.ts @@ -6,11 +6,7 @@ export const sharedTooltipProps = { delayDuration: 1000, }; -export type DisplayOption = - | "all-guides" - | "only-active" - | "only-eligible" - | "only-displayable"; +export type DisplayOption = "all-guides" | "only-active" | "only-eligible"; // Use this param to start Toolbar and enter into a debugging session when // it is present and set to true. From 69b30eebf93eb5394456ba94c9f53a7777935e11 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 16:07:41 -0400 Subject: [PATCH 5/8] changeset --- .changeset/violet-heads-go.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/violet-heads-go.md diff --git a/.changeset/violet-heads-go.md b/.changeset/violet-heads-go.md new file mode 100644 index 000000000..d4b497c4d --- /dev/null +++ b/.changeset/violet-heads-go.md @@ -0,0 +1,5 @@ +--- +"@knocklabs/react": patch +--- + +[Guides] Address more polish + feedback items in guide toolbar v2 From ce46e531c55e800168c4a0dd993a4b2870e5d9c2 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 17:49:36 -0400 Subject: [PATCH 6/8] cursor review feedback --- .../components/Toolbar/V2/GuideRowDetails.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx index b0295ef46..d9323a2ef 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx @@ -58,17 +58,19 @@ const StatusRow = ({ - - - {label}: - - {/* User children over value when provided, for cases when we want to - have its own tooltip over it */} - {!children && ( - - {value} + + + + {label}: - )} + {/* User children over value when provided, for cases when we want to + have its own tooltip over it */} + {!children && ( + + {value} + + )} + {children} From 180a63bdee52411c2fba781d9b7eaf1877cbc4c8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 17:56:40 -0400 Subject: [PATCH 7/8] margin tweak --- .../src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx index d9323a2ef..6c4f8987d 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx @@ -35,7 +35,7 @@ const CardContainer = ({ {title} - + {children} From c02e6009e94c89b7b8b4b429b6a8ceb1b0fbe9d8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Apr 2026 18:03:13 -0400 Subject: [PATCH 8/8] more style fix --- .../components/Toolbar/V2/GuideRowDetails.tsx | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx index 6c4f8987d..d89c499db 100644 --- a/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx +++ b/packages/react/src/modules/guide/components/Toolbar/V2/GuideRowDetails.tsx @@ -56,24 +56,22 @@ const StatusRow = ({ }) => { return ( - - - - - - {label}: + + + + + {label}: + + {/* User children over value when provided, for cases when we want to + have its own tooltip over it */} + {!children && ( + + {value} - {/* User children over value when provided, for cases when we want to - have its own tooltip over it */} - {!children && ( - - {value} - - )} - - - {children} - + )} + + + {children} ); };