From eefa8d422289a378c0e4cc4bb730ece7372b40b3 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 22 Apr 2026 19:04:35 -0400 Subject: [PATCH] Add year headings to compare version select (#12138) * Add year headings to compare version select * Address review feedback on heading options Use stable keys for heading options and set explicit displayName. Co-Authored-By: Claude Opus 4.7 --------- Co-authored-by: Claude Opus 4.7 --- app/components/InputSelect.tsx | 26 +++++++++++++++++- app/components/primitives/InputSelect.tsx | 27 +++++++++++++++++++ .../History/HighlightChangesControl.tsx | 16 ++++++++++- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/app/components/InputSelect.tsx b/app/components/InputSelect.tsx index ae27a55431..7111993fcb 100644 --- a/app/components/InputSelect.tsx +++ b/app/components/InputSelect.tsx @@ -21,6 +21,7 @@ import { InputSelectContent, InputSelectItem, InputSelectSeparator, + InputSelectHeading, InputSelectTrigger, type TriggerButtonProps, } from "./primitives/InputSelect"; @@ -35,6 +36,13 @@ type Separator = { type: "separator"; }; +type Heading = { + /* Denotes a non-selectable heading rendered above a group of options. */ + type: "heading"; + /* Text shown as the heading label. */ + label: string; +}; + export type Item = { /* Denotes a selectable option in the menu. */ type: "item"; @@ -48,7 +56,7 @@ export type Item = { icon?: React.ReactElement; }; -export type Option = Item | Separator; +export type Option = Item | Separator | Heading; type Props = Omit, "onChange"> & { /* Options to display in the select menu. */ @@ -118,6 +126,14 @@ export const InputSelect = React.forwardRef( return ; } + if (option.type === "heading") { + return ( + + {option.label} + + ); + } + return (