Skip to content

[ADR-176] Dynamic CSS for layout#144

Merged
jodavis merged 4 commits intofeature/ADR-162-client-side-layout-updatesfrom
claude/implement-adr-176-UTnec
Apr 18, 2026
Merged

[ADR-176] Dynamic CSS for layout#144
jodavis merged 4 commits intofeature/ADR-162-client-side-layout-updatesfrom
claude/implement-adr-176-UTnec

Conversation

@jodavis
Copy link
Copy Markdown
Owner

@jodavis jodavis commented Apr 18, 2026

No description provided.

- 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
@jodavis jodavis changed the base branch from main to feature/ADR-162-client-side-layout-updates April 18, 2026 16:54
@jodavis jodavis changed the title Update spec.md with new guidance on the spec process. [ADR-176] Dynamic CSS for layout Apr 18, 2026
@jodavis jodavis requested a review from Copilot April 18, 2026 16:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 #ROOT grid layout CSS from wwwroot/css/app.css into an embedded layout-grid.css resource.
  • Added IDynamicStylesheetProvider + LayoutStylesheetProvider and registered it in DI.
  • Injected the active layout CSS into Remote.razor via an inline <style> tag; updated app.min.css accordingly.

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.

Comment thread src/AdaptiveRemote.App/Services/Layout/layout-grid.css Outdated
Copy link
Copy Markdown
Owner Author

@jodavis jodavis left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/AdaptiveRemote.App/wwwroot/css/app.css
@jodavis
Copy link
Copy Markdown
Owner Author

jodavis commented Apr 18, 2026

@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.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

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 r...

Implemented in 1231716 (plus follow-up b456923): added a new Headless E2E scenario that asserts #ROOT stylesheet rules (display, grid-template-rows, grid-template-columns, grid-gap) are present in the browser, updated the PR description checklist with the work/test status, and included the layout screenshot: https://github.com/user-attachments/assets/6880bb14-52f8-4d7f-9ec0-cfa948328ad0

@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.

Addressed in 1231716 and b456923: resolved both review sets (LESS source path fix, duplicate grid-gap cleanup, and new browser-level layout CSS E2E coverage). Build now passes with dotnet build /warnaserror /p:EnableWindowsTargeting=true; tests pass for AdaptiveRemote.App.Tests and Headless E2E. In this Linux runner, full dotnet test is still blocked by WindowsDesktop runtime requirements for WPF/Console hosts and a pre-existing AdaptiveRemote.Backend.ApiTests health-check log assertion failure. Screenshot: https://github.com/user-attachments/assets/6880bb14-52f8-4d7f-9ec0-cfa948328ad0

@github-actions
Copy link
Copy Markdown

Test Results

431 tests   431 ✅  2m 57s ⏱️
 12 suites    0 💤
 12 files      0 ❌

Results for commit 5408df3.

@jodavis jodavis merged commit 533865b into feature/ADR-162-client-side-layout-updates Apr 18, 2026
2 checks passed
@jodavis jodavis deleted the claude/implement-adr-176-UTnec branch April 18, 2026 18:39
jodavis added a commit that referenced this pull request Apr 21, 2026
* 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>
jodavis added a commit that referenced this pull request Apr 23, 2026
* 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>
jodavis added a commit that referenced this pull request Apr 23, 2026
* 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>
jodavis added a commit that referenced this pull request Apr 29, 2026
* 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>
jodavis added a commit that referenced this pull request Apr 29, 2026
* 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>
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.

4 participants