Skip to content

feat: data-selection suite — DataPicker, MultiSelect, TagInput, CommandPalette#25

Merged
Shewart merged 13 commits into
mainfrom
feat/data-selection-suite
Jul 3, 2026
Merged

feat: data-selection suite — DataPicker, MultiSelect, TagInput, CommandPalette#25
Shewart merged 13 commits into
mainfrom
feat/data-selection-suite

Conversation

@Shewart

@Shewart Shewart commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Ships four flagship components covering the "searchable list in a floating panel" primitive that was missing since 0.3.

The four components

DataPicker<TItem, TKey> — the typed sibling of the string-only Combobox. Bind to a list of real domain objects (users, products, frameworks) via KeySelector. Templated SelectedTemplate + OptionTemplate for rich rendering; pluggable SearchPredicate; auto-focus search on open; ↑/↓/Enter/Esc keyboard nav.

MultiSelect<TItem, TKey> — same primitives, multi-value chip output. Selected items render as chips with inline X-remove; toggling rows in the popover adds/removes. Optional ChipTemplate for custom chip rendering.

TagInput — free-form tag entry. Enter to add, Backspace on empty removes last, paste comma/newline-separated to bulk-add. Optional MaxTags and AllowDuplicates.

CommandPalette — wraps existing Command with a global keyboard shortcut (default Cmd+K / Ctrl+K). Configurable HotkeyChar, UseCtrl, UseMeta, UseShift, UseAlt. Disposes cleanly per instance (GUID-keyed listener registry).

Full usage examples live in the demo doc pages under /components/form/* and /components/overlay/command-palette.

JS-interop pattern (fixed a pre-existing inconsistency)

While wiring CommandPalette I found shellui.js in the ShellUI.Components package shipped only ES-module exports, but InputOTP (already live in the package) called window.ShellUI.focusElement — so its focus behavior silently no-op'd for Path A/B consumers. Fix:

File Change
src/ShellUI.Components/wwwroot/shellui.js Now publishes as window.ShellUI monolith and as ES-module exports. Backwards-compatible either way it's loaded.
src/ShellUI.Templates/Templates/ShellUIJsTemplate.cs Adds registerShortcut / unregisterShortcut to the window.ShellUI monolith that shellui init writes to Path C consumers.
src/ShellUI.Components/Components/CommandPalette.razor (live) Hybrid: tries module import first (Path A/B via NuGet), falls back to window.ShellUI (Path C). Same pattern CopyButton uses.
src/ShellUI.Components/Components/InputOTP.razor (live) Same hybrid pattern — was silently no-op'd for Path A/B, now works.
src/ShellUI.Templates/Templates/CommandPaletteTemplate.cs (CLI) window.ShellUI only — Path C consumers own shellui.js and always have the global.

Live/template @code blocks legitimately diverge for command-palette and input-otp; documented in TemplateSyncTests.AllowedDrift with reasons.

Sidebar now inlines cleanly

Added [Parameter] public bool Inline { get; set; } — when true, swaps position: fixed for absolute and h-svh for h-full so the sidebar stays inside a bounded parent. Mobile fullscreen sheet branch is skipped in inline mode. Kept in sync across the live component, the demo copy, and the CLI template.

Enabled the NavigationDemo Sidebar showcase on Home to come back with <Sidebar Inline="true"> — no more escape-to-viewport, no more visual confusion with the DashboardLayout sidebar.

Registry, safelist, dependencies

  • Four new templates registered in ComponentRegistry.cs (metadata + content).
  • command-palette declares Dependencies = ["command", "shellui-js"] so dotnet shellui add command-palette pulls the palette UI + JS glue automatically.
  • Safelist regenerated: 307 → 367 classes (chip/palette utilities: min-h-10, min-w-24, flex-wrap, shrink-0, etc.)

Demo project (NET10/BlazorInteractiveServer) — full doc pages

Four new component source files installed as if via shellui add, plus four dedicated doc pages with Installation, Usage (multiple variants), API Reference, and (for CommandPalette) Keyboard sections:

Page Route
DataPicker /components/form/data-picker
MultiSelect /components/form/multi-select
TagInput /components/form/tag-input
CommandPalette /components/overlay/command-palette

Sidebar (AppSidebar.razor) and components index (Index.razor) updated with entries and Font Awesome icons. Demo's wwwroot/shellui.js gets the shortcut functions.

Preview project (NET10/ShellUI.Preview)

Four preview cases in ComponentPreview.razor with sample data + four tiles on the Home grid.

Demo UX polish (layout-flow fixes)

Not strictly a "data-selection" change, but the demo's Home page was falling apart in ways that made the new components hard to showcase properly:

Page Was Now Why
/ (Home) DashboardLayout MainLayout Landing chrome (top navbar, footer). The dashboard sidebar didn't belong on the marketing landing page.
/blocks DashboardLayout BlocksLayout BlocksLayout was already written for this page (has "Back to Dashboard" header). Dashboard sidebar competed with the layout blocks it was demoing.

/dashboard and /components/* retain DashboardLayout (correct — sidebar navigation is the point there).

Files

File Kind
src/ShellUI.Components/Components/DataPicker.razor (new) Live component
src/ShellUI.Components/Components/MultiSelect.razor (new) Live component
src/ShellUI.Components/Components/TagInput.razor (new) Live component
src/ShellUI.Components/Components/CommandPalette.razor (new) Live component
src/ShellUI.Components/Components/Sidebar.razor Inline parameter
src/ShellUI.Components/Components/InputOTP.razor Hybrid JS interop
src/ShellUI.Components/wwwroot/shellui.js Hybrid window.ShellUI + ES-module
src/ShellUI.Templates/Templates/*.cs (4 new + ShellUIJsTemplate.cs, SidebarTemplate.cs, InputOTPTemplate.cs updated) CLI templates
src/ShellUI.Templates/ComponentRegistry.cs 4 metadata + 4 content entries
src/ShellUI.Components/wwwroot/shellui-classes.txt + build/*.targets Regenerated safelist
NET10/BlazorInteractiveServer/Components/UI/*.razor (4 new + Sidebar.razor updated) Demo Path-C installation
NET10/BlazorInteractiveServer/Components/Pages/Components/Form/*Doc.razor (3 new) + Overlay/CommandPaletteDoc.razor Demo doc pages
NET10/BlazorInteractiveServer/Components/Pages/{Home,Blocks}.razor Layout swaps
NET10/BlazorInteractiveServer/Components/Pages/Components/Index.razor Nav links
NET10/BlazorInteractiveServer/Components/UI/AppSidebar.razor Sidebar entries
NET10/BlazorInteractiveServer/Components/Demo/NavigationDemo.razor Inline Sidebar demo (now uses Inline="true")
NET10/BlazorInteractiveServer/wwwroot/shellui.js Shortcut functions
NET10/ShellUI.Preview/Pages/{ComponentPreview,Home}.razor Preview cases + tiles
ShellUI.Tests/TemplateSyncTests.cs 4 new drift InlineData rows + AllowedDrift entries for command-palette and input-otp

Test plan

  • dotnet test80/80 green (76 previous + 3 new drift InlineData rows; command-palette and input-otp correctly skipped via AllowedDrift)
  • dotnet shellui list surfaces all 4 new components with correct categories
  • Preview app: all 4 preview URLs work; DataPicker keyboard nav (↑↓/Enter/Esc); MultiSelect chip remove + counter; TagInput Enter/Backspace/paste bulk-add; CommandPalette Cmd+K toggle
  • Demo app: sidebar nav entries appear under Form/Overlay; each doc page loads with Usage examples working; / (Home) uses MainLayout landing chrome; /blocks uses BlocksLayout; /dashboard + /components/* unchanged
  • Home page: zero fixed inset-y-0 sidebars in served HTML; one data-sidebar="sidebar" inline demo rendering with absolute positioning inside its bounded card
  • Live↔template drift check passes for data-picker, multi-select, tag-input; command-palette and input-otp legitimately diverge (documented reasons)

Shewart added 13 commits July 4, 2026 00:04
Enhanced the `TemplateSyncTests` by adding new inline data for the `data-picker`, `multi-select`, `tag-input`, and `command-palette` components. This improves test coverage for template synchronization, ensuring that the new components are correctly matched with their corresponding Razor files.
Enhanced the `ShellUI.Components.targets` file by adding new safelist entries for `flex-wrap`, `focus:ring-1`, `hover:text-destructive`, `left-2`, and `min-w-24`. These additions expand the available utility classes, improving styling flexibility and responsiveness in the ShellUI components.
Introduced four new components: `CommandPalette`, `DataPicker`, `MultiSelect`, and `TagInput`. These components enhance user interaction by providing command selection, date picking, multi-selection capabilities, and tag input functionality, respectively. Each component includes customizable parameters and event callbacks to improve usability and integration within the ShellUI framework.
Introduced four new components: `CommandPalette`, `DataPicker`, `MultiSelect`, and `TagInput`. These components provide improved user interaction through command selection, date picking, multi-value selection, and tag input functionalities. Each component is designed with customizable parameters and event callbacks to enhance usability within the ShellUI framework.
…ionality

Added entries for `command-palette`, `data-picker`, `multi-select`, and `tag-input` to the `ComponentRegistry`. This update integrates the new components into the ShellUI framework, allowing for improved user interaction and functionality across the application.
Updated `shellui-classes.txt` to include new utility classes: `flex-wrap`, `focus:ring-1`, `hover:text-destructive`, `left-2`, and `min-w-24`, improving styling options. Additionally, implemented keyboard shortcut registration and unregistration functions in `shellui.js`, allowing for customizable keyboard interactions within the ShellUI framework.
Introduced `DataPicker`, `MultiSelect`, `TagInput`, and `CommandPalette` components to the ShellUI framework. These components enhance user interaction by providing functionalities for date picking, multi-value selection, free-form tag entry, and command execution via keyboard shortcuts. Each component includes customizable parameters and event callbacks to improve usability and integration within the application.
Added links for `DataPicker`, `MultiSelect`, `TagInput`, and `CommandPalette` components in the Index.razor file. This enhances navigation and accessibility to the newly introduced components within the ShellUI framework.
…r functionality

Enhanced the NavigationDemo component by adding an inline mode description for the sidebar and adjusting the layout references in Blocks.razor and Home.razor to use BlocksLayout and MainLayout respectively. This improves user experience and consistency across the application.
…ction

Introduced `DataPicker`, `MultiSelect`, `TagInput`, and `CommandPalette` components in the ComponentPreview.razor file, allowing users to interactively select frameworks, manage multiple selections, input tags, and execute commands via keyboard shortcuts. Updated Home.razor to include corresponding entries for these components, improving navigation and accessibility within the ShellUI framework.
…shellui.js

Added functions for registering and unregistering keyboard shortcuts in shellui.js, allowing for customizable keyboard interactions. Updated CommandPalette and InputOTP components to utilize these new functions, enhancing user experience through improved keyboard navigation. Also, modified Sidebar component to support an inline mode for better layout flexibility.
…yboard shortcut handling

Updated the CommandPaletteTemplate to include a new dependency on "shellui-js" and modified the shortcut registration logic for better error handling. Improved the InputOTPTemplate by refining the focus input method to handle index validation more effectively. Additionally, introduced an inline mode parameter in the SidebarTemplate for enhanced layout flexibility.
…JS-interop path differences

Added entries to the AllowedDrift dictionary in TemplateSyncTests.cs to document discrepancies in JS-interop paths between the NuGet package and CLI template for the CommandPalette and InputOTP components. This enhances test clarity and aids in addressing potential integration issues.
Copilot AI review requested due to automatic review settings July 3, 2026 23:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Shewart Shewart merged commit 94751d9 into main Jul 3, 2026
1 check passed
@Shewart Shewart deleted the feat/data-selection-suite branch July 3, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants