[ADR-176] Dynamic CSS for layout#144
[ADR-176] Dynamic CSS for layout#144jodavis merged 4 commits intofeature/ADR-162-client-side-layout-updatesfrom
Conversation
- Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc
There was a problem hiding this comment.
Pull request overview
Adds a mechanism to inject layout-specific CSS at runtime, moving the grid layout rules out of the global app stylesheet and into an embedded resource served via a scoped provider.
Changes:
- Extracted
#ROOTgrid layout CSS fromwwwroot/css/app.cssinto an embeddedlayout-grid.cssresource. - Added
IDynamicStylesheetProvider+LayoutStylesheetProviderand registered it in DI. - Injected the active layout CSS into
Remote.razorvia an inline<style>tag; updatedapp.min.cssaccordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/AdaptiveRemote.App.Tests/Services/Layout/LayoutStylesheetProviderTests.cs | Adds a unit test for the new stylesheet provider. |
| src/AdaptiveRemote.App/wwwroot/css/app.min.css | Removes the minified #ROOT grid layout CSS from the global bundle. |
| src/AdaptiveRemote.App/wwwroot/css/app.css | Removes #ROOT grid layout CSS from the global stylesheet. |
| src/AdaptiveRemote.App/Services/Layout/layout-grid.css | Introduces extracted grid-layout CSS to be injected dynamically. |
| src/AdaptiveRemote.App/Services/Layout/LayoutStylesheetProvider.cs | Loads embedded layout CSS and exposes it via IDynamicStylesheetProvider. |
| src/AdaptiveRemote.App/Services/Layout/IDynamicStylesheetProvider.cs | Defines the dynamic stylesheet provider abstraction. |
| src/AdaptiveRemote.App/Configuration/HostBuilderExtensions.cs | Registers the stylesheet provider in the DI container. |
| src/AdaptiveRemote.App/Components/Remote.razor | Injects and renders the dynamic CSS into the component output. |
| src/AdaptiveRemote.App/AdaptiveRemote.App.csproj | Embeds layout-grid.css as an EmbeddedResource. |
jodavis
left a comment
There was a problem hiding this comment.
Is there a way we can add an E2E test to verify the layout CSS is being applied? Something that makes sure the layout isn't messed up would be great, but at least something that ensures the expected rules exist in the browser.
Also, update the PR description with the changes that have been made here. If you can, include a screenshot of the layout. If you run the Headless Host tests, they should record playwright traces that you can pull a screenshot out of.
|
@copilot Address the code review comments from both code reviews in this PR. Make sure the whole repo builds without warnings or errors, and that all tests pass. |
…rtions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Implemented in 1231716 (plus follow-up b456923): added a new Headless E2E scenario that asserts
Addressed in 1231716 and b456923: resolved both review sets (LESS source path fix, duplicate |
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Test Results431 tests 431 ✅ 2m 57s ⏱️ Results for commit 5408df3. |
533865b
into
feature/ADR-162-client-side-layout-updates
* Implement ADR-176: CSS extraction and stub IDynamicStylesheetProvider - Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc * Address ADR-176 review feedback with LESS cleanup and layout E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address validation feedback in layout CSS E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify sync behavior in stylesheet test-service extensions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
* Implement ADR-176: CSS extraction and stub IDynamicStylesheetProvider - Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc * Address ADR-176 review feedback with LESS cleanup and layout E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address validation feedback in layout CSS E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify sync behavior in stylesheet test-service extensions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
* Implement ADR-176: CSS extraction and stub IDynamicStylesheetProvider - Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc * Address ADR-176 review feedback with LESS cleanup and layout E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address validation feedback in layout CSS E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify sync behavior in stylesheet test-service extensions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
* Implement ADR-176: CSS extraction and stub IDynamicStylesheetProvider - Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc * Address ADR-176 review feedback with LESS cleanup and layout E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address validation feedback in layout CSS E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify sync behavior in stylesheet test-service extensions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
* Implement ADR-176: CSS extraction and stub IDynamicStylesheetProvider - Define IDynamicStylesheetProvider interface in Services/Layout/ - Extract #ROOT grid CSS from app.css into layout-grid.css embedded resource - Implement LayoutStylesheetProvider v1 returning the static grid CSS - Wire Remote.razor to inject <style> block via IDynamicStylesheetProvider - Remove grid CSS from app.css and app.min.css - Register LayoutStylesheetProvider as IDynamicStylesheetProvider (scoped) - Add unit test: LayoutStylesheetProvider.GetCss() returns non-null content https://claude.ai/code/session_01TEWzyYT1ytqqG5a26XDwHc * Address ADR-176 review feedback with LESS cleanup and layout E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address validation feedback in layout CSS E2E assertions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify sync behavior in stylesheet test-service extensions Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/aad88066-aa85-4c6c-aca5-4fde8c3cf6a2 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
No description provided.