Use CSS variables and redesign agent pages#1
Conversation
Replace hard-coded colors, sizes and radii with CSS custom properties across layout and nav styles to enable theming and easier customization. Rework NavMenu to use category color variables and simplify prompting category markup. Revamp multiple Agent pages (Agent01–Agent09, Agent11–Agent23, etc.) with a consistent page header, two-column config/result layout, streaming indicators, clearer panels (config, result, log, thread), improved buttons and accessibility cues. Add a local image asset (wwwroot/image.jpg) and a UI design system draft (plans/ui-design-system.md). Minor readme update included. These changes improve visual consistency, theming, and UX for the AgentsWebUI.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca4c63d5ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR centralizes the AgentsWebUI styling into a token-based design system (app.css) and refactors the Home, navigation, and multiple Agent sample pages to use consistent panels/layouts and category-based theming.
Changes:
- Introduces a single, CSS-variable-driven design system in
wwwroot/app.cssand removesHome.razor.css. - Updates Home + NavMenu to use category theme classes/variables and shared components (hero banner, agent cards, nav headers).
- Revamps Agent01–Agent23 pages (and error/not-found pages) with consistent headers, two-column layouts, panels, and streaming/loading indicators; Agent08 switches to a local image asset.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| readme.md | Rewrites README with new project overview and configuration/run instructions. |
| plans/ui-design-system.md | Adds a design system spec aligned to the new centralized CSS approach. |
| 0-Agents/AgentsWebUI/wwwroot/app.css | Adds the centralized design system (tokens + shared component/layout classes). |
| 0-Agents/AgentsWebUI/Components/Pages/NotFound.razor | Updates NotFound UI to use page header + panel + alert styles. |
| 0-Agents/AgentsWebUI/Components/Pages/Home.razor.css | Removes scoped Home CSS in favor of centralized app.css. |
| 0-Agents/AgentsWebUI/Components/Pages/Home.razor | Refactors hero/category sections to use design-system classes and btn-cat. |
| 0-Agents/AgentsWebUI/Components/Pages/Error.razor | Refactors error page to panel-based layout with clearer messaging. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent01.razor | Refactors Agent01 layout into header + config/result panels with streaming indicators. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent02.razor | Refactors Agent02 into header + config + chat-thread UI using shared chat styles. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent03.razor | Refactors Agent03 into consistent config/result/log panels. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent04.razor | Refactors Agent04 into consistent config/result/log panels with approval messaging. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent05.razor | Refactors Agent05 into consistent config/result panels plus structured-output callout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent06.razor | Refactors Agent06 into consistent config/result/log/thread panels. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent07.razor | Refactors Agent07 into consistent config/result/log/thread panels. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent08.razor | Updates image sample UI and switches image handling toward a local asset. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent09.razor | Refactors Agent09 into consistent panels + MCP callout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent10.razor | Refactors Agent10 into consistent panels + delegation callout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent11.razor | Refactors Agent11 into consistent panels + reduction callout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent12.razor | Refactors Agent12 into consistent panels + Azure-only warning. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent13.razor | Refactors Agent13 into consistent panels + DI/plugins callout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent14.razor | Refactors Agent14 into consistent panels + middleware pipeline info. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent15.razor | Refactors Agent15 into panel layout and adds an in-page YAML definition block. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent16.razor | Refactors Agent16 into panel layout with reasoning/usage display. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent17.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent18.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent19.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent20.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent21.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent22.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Pages/Agent23.razor | Refactors prompting strategy pages into a consistent panel-based layout. |
| 0-Agents/AgentsWebUI/Components/Layout/NavMenu.razor.css | Migrates key nav styles to CSS variables/tokens with fallbacks. |
| 0-Agents/AgentsWebUI/Components/Layout/NavMenu.razor | Updates nav category headers to use CSS variable-based category colors. |
| 0-Agents/AgentsWebUI/Components/Layout/MainLayout.razor.css | Migrates layout colors/sizes to design-system CSS variables with fallbacks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| // Load image binary from local image file at wwwroot/image.jpg | ||
|
|
||
| var imageData = await File.ReadAllBytesAsync("wwwroot/image.jpg"); | ||
| var imageContent = new DataContent(imageData, "image/jpeg"); |
There was a problem hiding this comment.
File.ReadAllBytesAsync("wwwroot/image.jpg") relies on the current working directory and will break when the app is hosted with a different content root. Prefer resolving the path via IWebHostEnvironment.WebRootPath / WebRootFileProvider (or inject IWebHostEnvironment) and combine with image.jpg.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> | ||
| @(isLoading ? "Running..." : "🩷 Submit") | ||
| </button> | ||
| <button class="btn btn-outline-secondary" @onclick="OnSubmitStream" disabled="@isLoading"> | ||
| @(isLoading ? "Running..." : "📡 Stream") |
There was a problem hiding this comment.
These prompting-strategy pages are still using a hard-coded inline color (#e83e8c) for the primary action. Since this PR’s goal is to centralize colors via CSS custom properties, consider adding a reusable button class in app.css (e.g., .btn-pink or .btn-prompting using --color-cat-prompting) and switch to that class instead of inline styles.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| <div class="d-flex align-items-center gap-3 mb-2"> | ||
| <span style="font-size:2.5rem;" aria-hidden="true">🤖</span> | ||
| <span aria-hidden="true" style="font-size:2.5rem;">🤖</span> | ||
| <h1 class="display-5 fw-bold mb-0">Microsoft Agent Framework Samples</h1> |
There was a problem hiding this comment.
The hero icon still uses an inline font-size. If the intent is to eliminate hard-coded sizes in markup, consider moving this to a CSS class (e.g., .hero-icon) and/or a design token-based size so it can be themed consistently.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@pournasserian I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@pournasserian I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@pournasserian I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: pournasserian <24959477+pournasserian@users.noreply.github.com>
Co-authored-by: pournasserian <24959477+pournasserian@users.noreply.github.com>
…KEY fallback Co-authored-by: pournasserian <24959477+pournasserian@users.noreply.github.com>
Fix image path resolution in Agent08 using IWebHostEnvironment
Scope dark `pre` styling to `.code-block` opt-in class
Align API key configuration: OpenRouter:ApiKey with OPEN_ROUTER_API_KEY fallback
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| <p class="card-text">@((MarkupString)RenderMarkdown(@response))</p> | ||
| <div class="mb-3"> | ||
| <label class="form-label">Instructions</label> | ||
| <InputTextArea @bind-Value="instructions" class="form-control instructions-input" style="min-height: 300px;"></InputTextArea> |
There was a problem hiding this comment.
This inline style="min-height: 300px;" reintroduces per-page styling that the central design system is trying to eliminate. Consider adding a dedicated class/token-driven variant for tall instruction inputs (e.g., .instructions-input-lg) in app.css and use that instead.
| <InputTextArea @bind-Value="instructions" class="form-control instructions-input" style="min-height: 300px;"></InputTextArea> | |
| <InputTextArea @bind-Value="instructions" class="form-control instructions-input instructions-input-lg"></InputTextArea> |
| <div class="card-body"> | ||
| <div class="response-text"> @((MarkupString)RenderMarkdown(response))</div> | ||
| </div> |
There was a problem hiding this comment.
The response is rendered as HTML via MarkupString after Markdown-to-HTML conversion. Markdig allows raw HTML by default, so model output that includes HTML/JS (e.g., <script> or onerror=) could be executed in the browser. Consider disabling HTML in the Markdig pipeline or sanitizing the generated HTML before rendering.
| } | ||
| </div> | ||
| <div class="card-body"> | ||
| <div class="response-text">@((MarkupString)RenderMarkdown(@response))</div> |
There was a problem hiding this comment.
The AI response is converted from Markdown to HTML and rendered via MarkupString. Because Markdig allows raw HTML by default, untrusted model output could inject executable HTML/JS. Consider disabling HTML in the Markdig pipeline and/or sanitizing the generated HTML before rendering.
| <div class="response-text">@((MarkupString)RenderMarkdown(@response))</div> | |
| <div class="response-text"> | |
| @((MarkupString)new Ganss.Xss.HtmlSanitizer().Sanitize(RenderMarkdown(response))) | |
| </div> |
| <div class="response-text">@((MarkupString)response)</div> | ||
| </div> |
There was a problem hiding this comment.
This renders model output as HTML via MarkupString. Since the HTML comes from Markdown.ToHtml(...) and Markdig permits raw HTML by default, this can open an XSS vector if the model returns HTML/JS. Consider disabling HTML in the Markdig pipeline or sanitizing the generated HTML before rendering.
| <div class="mb-2 small text-muted"> | ||
| Graph: <code>Input → Decomposer → Node1, Node2 → Synthesizer → Output</code> | ||
| </div> | ||
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> |
There was a problem hiding this comment.
This button uses an inline hard-coded color (#e83e8c). To support theming via CSS variables, consider moving this into a design-system class (e.g., .btn-prompting using var(--color-cat-prompting)) and removing the inline style.
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> | |
| <button class="btn btn-prompting" @onclick="OnSubmit" disabled="@isLoading"> |
| Tools: <span class="badge badge-primary">SearchWeb</span> <span class="badge badge-success">Calculate</span> <span class="badge badge-primary">LookupFact</span> | ||
| </div> | ||
| <div class="d-flex gap-2 flex-wrap"> | ||
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> |
There was a problem hiding this comment.
The Submit button uses an inline hard-coded color (#e83e8c). To keep the prompting category theme centralized and configurable, consider using a design-system class (e.g., .btn-prompting using var(--color-cat-prompting)) instead of inline styling.
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> | |
| <button class="btn btn-prompting" @onclick="OnSubmit" disabled="@isLoading"> |
| <div class="hero-banner mb-5"> | ||
| <div class="d-flex align-items-center gap-3 mb-2"> | ||
| <span style="font-size:2.5rem;" aria-hidden="true">🤖</span> | ||
| <span aria-hidden="true" style="font-size:2.5rem;">🤖</span> |
There was a problem hiding this comment.
There is still an inline style (font-size:2.5rem) in the hero banner. Since this PR centralizes styling in app.css, consider moving this to a reusable class (e.g., .hero-icon) so sizing can be adjusted via tokens without editing Razor markup.
| <span aria-hidden="true" style="font-size:2.5rem;">🤖</span> | |
| <span class="hero-icon" aria-hidden="true">🤖</span> |
| <label class="form-label fw-semibold">Message</label> | ||
| <textarea class="form-control" rows="3" @bind="message"></textarea> | ||
| <div class="d-flex gap-2 flex-wrap"> | ||
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> |
There was a problem hiding this comment.
The primary action button uses an inline hard-coded color (#e83e8c). To keep theming centralized, consider replacing this with a design-system class (e.g., .btn-prompting using var(--color-cat-prompting)), or reuse an existing token-driven button variant instead of inline styles.
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> | |
| <button class="btn btn-primary" @onclick="OnSubmit" disabled="@isLoading"> |
| <div class="mb-2 small text-muted"> | ||
| Spawns 3 branches: <span class="badge badge-primary">Analytical</span> <span class="badge badge-success">Creative</span> <span class="badge badge-primary">Practical</span> | ||
| </div> | ||
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> |
There was a problem hiding this comment.
This button uses an inline hard-coded color (#e83e8c). Since the PR introduces category color tokens, consider using a token-driven CSS class (e.g., .btn-prompting / .btn-cat with var(--color-cat-prompting)) rather than inline styles to keep theming consistent.
| <button class="btn" style="background-color:#e83e8c;color:white;" @onclick="OnSubmit" disabled="@isLoading"> | |
| <button class="btn btn-cat btn-prompting" @onclick="OnSubmit" disabled="@isLoading"> |
| <div class="card-body"> | ||
| <div class="response-text">@((MarkupString)RenderMarkdown(@response))</div> | ||
| </div> |
There was a problem hiding this comment.
RenderMarkdown(...) output is rendered via MarkupString, which will render any HTML produced by Markdig. Since the markdown comes from an AI response, this can enable XSS if the model outputs raw HTML. Consider disabling HTML in the Markdig pipeline and/or sanitizing the HTML before rendering it.
|
@pournasserian I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@pournasserian I've opened a new pull request, #6, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@pournasserian I've opened a new pull request, #7, to work on those changes. Once the pull request is ready, I'll request review from you. |
…gent pages Co-authored-by: pournasserian <24959477+pournasserian@users.noreply.github.com>
…oken Co-authored-by: pournasserian <24959477+pournasserian@users.noreply.github.com>
Move hero icon font-size from inline style to CSS design token
Replace inline pink color with reusable `.btn-prompting` CSS class on prompting agent pages
Fix image path resolution in Agent08 using IWebHostEnvironment
Replace hard-coded colors, sizes and radii with CSS custom properties across layout and nav styles to enable theming and easier customization. Rework NavMenu to use category color variables and simplify prompting category markup. Revamp multiple Agent pages (Agent01–Agent09, Agent11–Agent23, etc.) with a consistent page header, two-column config/result layout, streaming indicators, clearer panels (config, result, log, thread), improved buttons and accessibility cues. Add a local image asset (wwwroot/image.jpg) and a UI design system draft (plans/ui-design-system.md). Minor readme update included. These changes improve visual consistency, theming, and UX for the AgentsWebUI.