-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ui): correct dark-mode heading/paragraph colours and add PageHeadingComponent #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5e6f2cf
feat(ui): style btn variants Bootstrap-like; add warning & destructive
5d34974
fix(ui): replace inline delete styling with btn-destructive in blog list
164f0f8
fix(ui): correct dark-mode heading/paragraph colours and add PageHead…
3fe5047
fix(ui): address PR #295 review threads — css, PageHeading, Profile, …
0d3d284
test(bunit): finalize PR #295 handoff for #291
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # PR #295 Review Fix Decisions | ||
|
|
||
| **Agent:** Legolas | ||
| **Date:** 2026-05-07 | ||
| **Branch:** squad/291-input-css-fine-tuning | ||
|
|
||
| ## Decisions Made | ||
|
|
||
| ### `.container-card` gains `mx-auto px-4` | ||
|
|
||
| The `.container-card` utility was bare `max-w-7xl` with no centering or padding. Aligned it to match the app's shared layout pattern (consistent with how `nav` wraps `mx-auto max-w-7xl px-4`). Any future page wrapper that adopts `.container-card` will automatically center and pad correctly. | ||
|
|
||
| ### `.btn-secondary` is a solid blue, not an outline button | ||
|
|
||
| The comment said "outline style" but the implementation was always solid blue fill. Chose to fix the comment (not the style) to preserve existing UX. The solid blue secondary button is the canonical pattern going forward. | ||
|
|
||
| ### `PageHeadingComponent` falls back to `<h1>` on unknown `Level` | ||
|
|
||
| Added a `default` switch arm that renders `<h1>`. Predictable output over silent empty rendering. | ||
|
|
||
| ### All four button variants use fixed palettes (no theme tokens) | ||
|
|
||
| All of `.btn-primary` (green), `.btn-secondary` (blue), `.btn-warning` (amber), `.btn-destructive` (red) use fixed Tailwind colour classes. None follow the user's colour-theme switch. The history.md learning entry from Issue #292 incorrectly stated that primary/secondary used `var(--primary-*)` tokens — corrected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <PageTitle>@HeaderText</PageTitle> | ||
|
|
||
| <header class="container-card"> | ||
|
|
||
| @switch (Level) | ||
| { | ||
| case "1": | ||
|
|
||
| <h1 class=@($"{TextColorClass}")>@HeaderText</h1> | ||
|
|
||
| break; | ||
|
|
||
| case "2": | ||
|
|
||
| <h2 class=@($"{TextColorClass}")>@HeaderText</h2> | ||
|
|
||
| break; | ||
|
|
||
| case "3": | ||
|
|
||
| <h3 class=@($"{TextColorClass}")>@HeaderText</h3> | ||
|
|
||
| break; | ||
|
|
||
| case "4": | ||
|
|
||
| <h4 class=@($"{TextColorClass}")>@HeaderText</h4> | ||
|
|
||
| break; | ||
|
|
||
| default: | ||
|
|
||
| <h1 class=@($"{TextColorClass}")>@HeaderText</h1> | ||
|
|
||
| break; | ||
| } | ||
|
|
||
| </header> | ||
|
|
||
| @code { | ||
|
|
||
| [Parameter] public string HeaderText { get; set; } = "My Blog"; | ||
|
|
||
| [Parameter] public string Level { get; set; } = "1"; | ||
|
|
||
| [Parameter] public string TextColorClass { get; set; } = string.Empty; | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,66 @@ | ||
| @page "/blog/create" | ||
| @using MyBlog.Web.Features.BlogPosts.Create | ||
| @inject ISender Sender | ||
| @inject NavigationManager Navigation | ||
| @rendermode InteractiveServer | ||
| @attribute [Authorize(Roles = "Author,Admin")] | ||
|
|
||
| <PageTitle>Create Post</PageTitle> | ||
|
|
||
| <h1 class="text-3xl font-bold mb-6">Create Post</h1> | ||
| <PageHeadingComponent HeaderText="Create Post" Level="1" TextColorClass="text-primary-900 dark:text-primary-50" /> | ||
|
|
||
| @if (_error is not null) | ||
| { | ||
| <div class="alert-error" role="alert"> | ||
| <span>@_error</span> | ||
| <button type="button" class="alert-dismiss" @onclick="() => _error = null">×</button> | ||
| </div> | ||
| <div class="alert-error" role="alert"> | ||
| <span>@_error</span> | ||
| <button type="button" class="alert-dismiss" @onclick="() => _error = null">×</button> | ||
| </div> | ||
| } | ||
|
|
||
| <div class="form-panel"> | ||
| <EditForm Model="_model" OnValidSubmit="HandleSubmit"> | ||
| <DataAnnotationsValidator /> | ||
| <ValidationSummary class="mb-4" /> | ||
| <EditForm Model="_model" OnValidSubmit="HandleSubmit"> | ||
| <DataAnnotationsValidator /> | ||
| <ValidationSummary class="mb-4" /> | ||
|
|
||
| <div class="form-group"> | ||
| <label class="form-label">Title</label> | ||
| <InputText class="form-input" @bind-Value="_model.Title" /> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label class="form-label">Author</label> | ||
| <InputText class="form-input" @bind-Value="_model.Author" /> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label class="form-label">Content</label> | ||
| <InputTextArea class="form-input" rows="8" @bind-Value="_model.Content" /> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label class="form-label">Title</label> | ||
| <InputText class="form-input" @bind-Value="_model.Title" /> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label class="form-label">Author</label> | ||
| <InputText class="form-input" @bind-Value="_model.Author" /> | ||
| </div> | ||
| <div class="form-group"> | ||
| <label class="form-label">Content</label> | ||
| <InputTextArea class="form-input" rows="8" @bind-Value="_model.Content" /> | ||
| </div> | ||
|
|
||
| <div class="flex gap-2"> | ||
| <button type="submit" class="btn-primary">Create</button> | ||
| <a href="/blog" class="btn-secondary">Cancel</a> | ||
| </div> | ||
| </EditForm> | ||
| <div class="flex gap-2"> | ||
| <button type="submit" class="btn-primary">Create</button> | ||
| <a href="/blog" class="btn-secondary">Cancel</a> | ||
| </div> | ||
| </EditForm> | ||
| </div> | ||
|
|
||
| @code { | ||
| private readonly PostFormModel _model = new(); | ||
| private string? _error; | ||
| private readonly PostFormModel _model = new(); | ||
| private string? _error; | ||
|
|
||
| private async Task HandleSubmit() | ||
| { | ||
| var result = await Sender.Send(new CreateBlogPostCommand(_model.Title, _model.Content, _model.Author)); | ||
| if (result.Success) | ||
| Navigation.NavigateTo("/blog"); | ||
| else | ||
| _error = result.Error; | ||
| } | ||
| private async Task HandleSubmit() | ||
| { | ||
| var result = await Sender.Send(new CreateBlogPostCommand(_model.Title, _model.Content, _model.Author)); | ||
| if (result.Success) | ||
| Navigation.NavigateTo("/blog"); | ||
| else | ||
| _error = result.Error; | ||
| } | ||
|
|
||
| private sealed class PostFormModel | ||
| { | ||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Title { get; set; } = string.Empty; | ||
| private sealed class PostFormModel | ||
| { | ||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Title { get; set; } = string.Empty; | ||
|
|
||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Author { get; set; } = string.Empty; | ||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Author { get; set; } = string.Empty; | ||
|
|
||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Content { get; set; } = string.Empty; | ||
| } | ||
| [System.ComponentModel.DataAnnotations.Required] | ||
| public string Content { get; set; } = string.Empty; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.