Skip to content

Add reusable Button component and migrate generic button markup app-wide#602

Merged
NikTilton merged 40 commits into
mainfrom
jschick/button-component
Jun 22, 2026
Merged

Add reusable Button component and migrate generic button markup app-wide#602
NikTilton merged 40 commits into
mainfrom
jschick/button-component

Conversation

@jschick04

Copy link
Copy Markdown
Collaborator

Summary

Introduces a reusable Button component hierarchy and migrates the duplicated <button class="button ..."> markup across the UI to use it. This removes markup duplication, centralizes the shared button contract, and structurally defaults type="button" so buttons inside forms no longer risk accidental submission.

Component

Added under src/EventLogExpert.UI/Inputs/ (alongside the existing input components):

  • ButtonBase: an abstract component with a single render path and all shared parameters (OnClick, Disabled, IconClass, IconOnly, Type defaulting to "button", CssClass, ChildContent, plus an attribute splat for aria-* / data-* / title / autofocus). It exposes Element and FocusAsync(preventScroll) for focus management and JS interop.
  • Thin sealed color variants: Button (default), PrimaryButton (green), DangerButton (red), WarningButton (yellow). Icon-only rendering is an orthogonal IconOnly flag rather than a separate type.

Scope

Migrated every button whose styling is the shared .button design system: the banners, the database-tools tabs, the filter editor, the filter library, the filter pane, the modal chrome, the debug log, and the empty-state dashboard's filter chip.

Left native by design (bespoke styling or event semantics outside the .button system): the filter-pane split-button compound, the sidebar tabs, the tag-chip remove controls, the master-selection checkbox, the filter predicate chips, the database-name button, and the dashboard / scenario launch tiles.

Component-scoped CSS targeting these buttons was preserved through ::deep in the affected stylesheets (with one component-root button's rule moved to the global stylesheet).

Testing

  • New ButtonTests (18 cases) cover the variant classes, icon rendering, the default type="button", the disabled state, the attribute splat, and click invocation.
  • The full UI test suite passes (915 tests) and the solution builds clean.

Copilot AI review requested due to automatic review settings June 19, 2026 14:09

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.

Pull request overview

Introduces a reusable ButtonBase component (plus variant wrappers) under EventLogExpert.UI.Inputs and migrates existing .button design-system usage across the UI to reduce duplicated markup and default type="button" for safer in-form usage.

Changes:

  • Added ButtonBase plus variant components (Button, PrimaryButton, DangerButton, WarningButton) and a comprehensive bUnit test suite for rendering/click/attribute-splat behavior.
  • Migrated many Razor views from raw <button class="button ..."> to the new components, including updates to CSS-isolation selectors via ::deep.
  • Moved one previously component-scoped button style (library-saved-tab-new-button) into the global stylesheet to keep styling working after migration.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/EventLogExpert.UI.Tests/Inputs/ButtonTests.cs Adds unit coverage for ButtonBase rendering, variants, default type, splatted attributes, and click behavior.
src/EventLogExpert.UI/wwwroot/app.css Adds global styling for library-saved-tab-new-button under the .button design system.
src/EventLogExpert.UI/Modal/ModalChrome.razor.css Updates isolated CSS selectors to use ::deep for button styling through the new component.
src/EventLogExpert.UI/Modal/ModalChrome.razor.cs Switches focus refs from ElementReference to component refs to support ButtonBase focus API.
src/EventLogExpert.UI/Modal/ModalChrome.razor Migrates modal chrome buttons to the new Button components.
src/EventLogExpert.UI/Inputs/WarningButton.cs Adds warning (yellow) button variant wrapper.
src/EventLogExpert.UI/Inputs/PrimaryButton.cs Adds primary (green) button variant wrapper.
src/EventLogExpert.UI/Inputs/DangerButton.cs Adds danger (red) button variant wrapper.
src/EventLogExpert.UI/Inputs/ButtonBase.cs Implements the reusable base button component with attribute splat, icon support, and focus API.
src/EventLogExpert.UI/Inputs/Button.cs Adds the default (no variant class) button wrapper.
src/EventLogExpert.UI/FilterPane/FilterPane.razor.css Adjusts isolated CSS to style nested button elements via ::deep after migration.
src/EventLogExpert.UI/FilterPane/FilterPane.razor Migrates filter pane buttons (including icon-only actions) to reusable Button components.
src/EventLogExpert.UI/FilterLibrary/TagManagementPanel.razor Migrates tag management action buttons to variant Button components.
src/EventLogExpert.UI/FilterLibrary/LibrarySavedTabHeader.razor.css Removes component-scoped styles that were moved global to keep styling after migration.
src/EventLogExpert.UI/FilterLibrary/LibrarySavedTabHeader.razor Migrates the “New saved filter” button to the reusable Button component.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryRow.razor.css Uses ::deep selectors to style button elements rendered by child components.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryRow.razor.cs Switches “more actions” focus/anchor handling to component refs and ButtonBase.Element.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryRow.razor Migrates library entry row buttons (expand, tags, favorite, menu) to reusable components.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryFilterEditor.razor.css Updates isolated selector to target nested button via ::deep.
src/EventLogExpert.UI/FilterLibrary/LibraryEntryFilterEditor.razor Migrates “Add filter” button to reusable Button component.
src/EventLogExpert.UI/FilterLibrary/FilterLibraryModal.razor Migrates modal retry and tag management trigger buttons to reusable components.
src/EventLogExpert.UI/FilterEditor/Rows/FilterRowHeader.razor.css Updates isolated selectors with ::deep for nested button styling.
src/EventLogExpert.UI/FilterEditor/Rows/FilterRowHeader.razor Migrates exclude/include toggle button to reusable Button component.
src/EventLogExpert.UI/FilterEditor/Rows/FilterRowActions.razor.cs Updates focus handling to use ButtonBase.Element instead of ElementReference.
src/EventLogExpert.UI/FilterEditor/Rows/FilterRowActions.razor Migrates row action icon buttons to Button/DangerButton.
src/EventLogExpert.UI/FilterEditor/Editing/FilterPredicateList.razor.css Updates isolated selectors with ::deep for nested button styling.
src/EventLogExpert.UI/FilterEditor/Editing/FilterPredicateList.razor.cs Updates focus handling to use a Button component ref.
src/EventLogExpert.UI/FilterEditor/Editing/FilterPredicateList.razor Migrates “add predicate” icon button to reusable Button component.
src/EventLogExpert.UI/FilterEditor/Editing/FilterPredicateEditor.razor Migrates predicate done/remove buttons to reusable components.
src/EventLogExpert.UI/FilterEditor/Editing/FilterEditPanel.razor.css Updates isolated selectors with ::deep for nested button styling.
src/EventLogExpert.UI/FilterEditor/Editing/FilterEditPanel.razor Migrates edit panel save/cancel/remove/exclude buttons to reusable components.
src/EventLogExpert.UI/DebugLog/DebugLogModal.razor Migrates footer actions (export/copy/refresh/clear) to reusable Button components.
src/EventLogExpert.UI/DatabaseTools/Tabs/UpgradeDatabaseTab.razor Migrates tool tab buttons (browse/run/cancel) to reusable components.
src/EventLogExpert.UI/DatabaseTools/Tabs/ShowProvidersTab.razor Migrates tool tab buttons (browse/run elevated/run/cancel) to reusable components.
src/EventLogExpert.UI/DatabaseTools/Tabs/MergeDatabaseTab.razor Migrates tool tab buttons (browse/run/cancel) to reusable components.
src/EventLogExpert.UI/DatabaseTools/Tabs/ManageDatabasesTab.razor.css Updates isolated selector to target nested button via ::deep.
src/EventLogExpert.UI/DatabaseTools/Tabs/ManageDatabasesTab.razor.cs Switches focus refs to component refs for selection/import/bulk actions.
src/EventLogExpert.UI/DatabaseTools/Tabs/ManageDatabasesTab.razor Migrates manage-databases actions (select/import/bulk/remove/save/discard) to reusable components.
src/EventLogExpert.UI/DatabaseTools/Tabs/DiffDatabasesTab.razor Migrates tool tab buttons (browse/run/cancel) to reusable components.
src/EventLogExpert.UI/DatabaseTools/Tabs/CreateDatabaseTab.razor Migrates tool tab buttons (browse/run elevated/run/cancel) to reusable components.
src/EventLogExpert.UI/DatabaseTools/DatabaseToolsLogView.razor Migrates toolbar actions (copy/export/jump) to reusable Button components.
src/EventLogExpert.UI/Database/DatabaseRecoveryModal.razor Migrates batch recovery action buttons to reusable Button components.
src/EventLogExpert.UI/Database/DatabaseEntryRow.razor.css Updates isolated selectors and reduced-motion rules to style nested buttons via ::deep.
src/EventLogExpert.UI/Database/DatabaseEntryRow.razor Migrates database entry row action buttons to reusable Button components.
src/EventLogExpert.UI/Dashboard/EmptyStateDashboard.razor Migrates empty-state “Clear filter” button to reusable Button component.
src/EventLogExpert.UI/Banner/UpgradeProgressBanner.razor Migrates banner cancel action to reusable Button component.
src/EventLogExpert.UI/Banner/InfoBanner.razor Migrates dismiss button to reusable Button component with icon support.
src/EventLogExpert.UI/Banner/ExportProgressBanner.razor Migrates banner cancel action to reusable Button component.
src/EventLogExpert.UI/Banner/ErrorBanner.razor Migrates banner action/dismiss buttons to reusable components.
src/EventLogExpert.UI/Banner/CriticalBanner.razor.cs Switches focus ref to a Button component ref for post-render focusing.
src/EventLogExpert.UI/Banner/CriticalBanner.razor Migrates banner action buttons (reload/relaunch/copy details) to reusable components.
src/EventLogExpert.UI/Banner/BannerHost.razor Migrates cycle navigation buttons to reusable icon buttons.
src/EventLogExpert.UI/Banner/AttentionBanner.razor Migrates action/dismiss buttons to reusable components.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/EventLogExpert.UI/DatabaseTools/Tabs/ManageDatabasesTab.razor.cs Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 6 comments.

Comment thread src/EventLogExpert.UI/Modal/ModalChrome.razor.css Outdated
Comment thread src/EventLogExpert.UI/FilterLibrary/LibraryEntryRow.razor.css Outdated
Comment thread src/EventLogExpert.UI/FilterLibrary/LibraryEntryFilterEditor.razor.css Outdated
Comment thread src/EventLogExpert.UI/DatabaseTools/Tabs/ManageDatabasesTab.razor.css Outdated
Comment thread src/EventLogExpert.UI/Database/DatabaseEntryRow.razor.css Outdated
Comment thread src/EventLogExpert.UI/Database/DatabaseEntryRow.razor.css Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Inputs/ButtonBase.cs

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Inputs/ButtonBase.cs Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.

Comment thread tests/Unit/EventLogExpert.UI.Tests/Inputs/ButtonTests.cs
Comment thread tests/Unit/EventLogExpert.UI.Tests/Inputs/ButtonTests.cs

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Inputs/ButtonBase.cs Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.

Comment thread tests/Unit/EventLogExpert.UI.Tests/Inputs/ButtonTests.cs Outdated
Comment thread tests/Unit/EventLogExpert.UI.Tests/Inputs/ButtonTests.cs Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 1 comment.

Comment thread src/EventLogExpert.UI/Banner/CriticalBanner.razor.cs Outdated

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.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 4 comments.

Comment thread src/EventLogExpert.UI/Inputs/ButtonBase.cs Outdated
Comment thread src/EventLogExpert.UI/FilterPane/FilterPane.razor Outdated
Comment thread src/EventLogExpert.UI/FilterPane/FilterPane.razor Outdated
Comment thread src/EventLogExpert.UI/FilterPane/FilterPane.razor Outdated
jschick04 added 21 commits June 21, 2026 15:35
Copilot AI review requested due to automatic review settings June 21, 2026 20: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.

Pull request overview

Copilot reviewed 135 out of 135 changed files in this pull request and generated 2 comments.

Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
Comment thread src/EventLogExpert.Runtime/EventLog/OpenLogEffects.cs
@NikTilton NikTilton merged commit f14da7b into main Jun 22, 2026
7 checks passed
@NikTilton NikTilton deleted the jschick/button-component branch June 22, 2026 15:10
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.

3 participants