Randomize homepage “Free and open source” quote with client-side quote pool#1170
Open
Copilot wants to merge 3 commits into
Open
Randomize homepage “Free and open source” quote with client-side quote pool#1170Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update 'free and open source' section with randomised quotes
Randomize homepage “Free and open source” quote with client-side quote pool
Jun 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the homepage “Free and open source” aside to display a randomized positioning quote on each visit, and extends unit coverage to validate the emitted quote pool and client-side randomization hook.
Changes:
- Replace the single localized body line in
FreeAndOpenSourceAsidewith a small in-code quote pool and inline client-side randomization. - Add
aria-live="polite"and a stable data attribute hook for updating the quote text. - Update unit tests to reflect the new rendering and to assert the randomization script/pool are present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/frontend/src/components/FreeAndOpenSourceAside.astro | Introduces the quote pool and inline script to randomize the displayed quote. |
| src/frontend/tests/unit/custom-components.vitest.test.ts | Updates render coverage and adds assertions for the new quote randomization output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
2
to
4
| /** | ||
| * This aside component displays a localized "Free & Open Source" message. | ||
| */ |
Comment on lines
+5
to
+16
| const aspireQuotes = [ | ||
| 'Aspire is the cloud-native app model for .NET.', | ||
| 'Aspire is orchestration for your distributed app stack.', | ||
| 'Aspire is local-first developer tooling for cloud-native apps.', | ||
| 'Aspire is built for observable, production-ready app development.', | ||
| 'Aspire is open source from app model to deployment artifacts.', | ||
| ]; | ||
| --- | ||
|
|
||
| <div class="free-open-source-aside"> | ||
| <p class="aside-title">{Astro.locals.t('landing.freeAndOSS')}</p> | ||
| <p> | ||
| {Astro.locals.t('landing.aspirePromise')} | ||
| </p> | ||
| <p data-random-aspire-quote aria-live="polite">{aspireQuotes[0]}</p> |
Comment on lines
+20
to
+26
| const quotes = aspireQuotes; | ||
| const quoteElement = document.querySelector('[data-random-aspire-quote]'); | ||
|
|
||
| if (quoteElement instanceof HTMLElement) { | ||
| const quoteIndex = Math.floor(Math.random() * quotes.length); | ||
| quoteElement.textContent = quotes[quoteIndex]; | ||
| } |
Comment on lines
+648
to
+652
| expect(html).toContain('data-random-aspire-quote'); | ||
| expect(html).toContain('Math.floor(Math.random() * quotes.length)'); | ||
| expect(html).toContain('Aspire is the cloud-native app model for .NET.'); | ||
| expect(html).toContain('Aspire is open source from app model to deployment artifacts.'); | ||
| }); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The homepage “Free and open source” section currently renders a single static statement. This change introduces a small curated quote pool and rotates the displayed quote per visit while preserving the existing layout and interaction model.
Component behavior update (
FreeAndOpenSourceAside.astro)Accessibility hardening
aria-live="polite"to the quote paragraph so assistive tech can announce updated text appropriately.document.querySelector('[data-random-aspire-quote]')) for quote target lookup.Focused test updates (
custom-components.vitest.test.ts)