Skip to content

Update landing page's UI layout#211

Open
KC900201 wants to merge 5 commits intoBuzzpy:masterfrom
KC900201:feature/205_update_ui
Open

Update landing page's UI layout#211
KC900201 wants to merge 5 commits intoBuzzpy:masterfrom
KC900201:feature/205_update_ui

Conversation

@KC900201
Copy link
Contributor

@KC900201 KC900201 commented Feb 15, 2026

Improvements included:

  • Move light/dark mode toggle button into top right of screen for easier accessibility
  • New footer component to move hero section (disclaimers) into footer
  • Add in DOM
  • Include test scripts for new component

Screenshot

Before

image

After

Header

Screenshot 2026-02-15 121747

Footer

Screenshot 2026-02-15 121812

@KC900201 KC900201 marked this pull request as ready for review February 21, 2026 15:17
Copilot AI review requested due to automatic review settings February 21, 2026 15:17
Copy link

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

This PR refactors the landing page UI by relocating the dark/light mode toggle button to the top-right corner as a fixed circular button, extracting footer content (copyright disclaimers) into a dedicated Footer component, and improving semantic HTML structure with the addition of a <main> element. The changes enhance accessibility and maintainability while reorganizing the Hero component's layout.

Changes:

  • Repositioned dark mode toggle button to fixed top-right position with circular styling
  • Created new Footer component to contain copyright and attribution information
  • Added semantic <main> element wrapping the core content sections
  • Introduced test suites for new ModeToggleButton and Footer components

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/styles/global.css Added CSS styles for the new fixed-position circular toggle button
src/scripts/hero-action.ts Updated dark mode toggle HTML to display icons only (removed text labels)
src/pages/index.astro Wrapped Hero, CardList, and Modal in <main> element and added Footer component
src/components/ModeToggleButton.test.ts New test file for the mode toggle button component
src/components/ModeToggleButton.astro New component for the dark/light mode toggle button
src/components/Hero.astro Restructured layout - moved toggle button out, removed footer content, reorganized title/paragraph positioning
src/components/Head.astro Formatting changes to improve code readability (multi-line attributes)
src/components/Footer.test.ts New test file for the footer component
src/components/Footer.astro New footer component containing copyright and attribution content
src/components/CardList.test.ts Removed unused vi import from Vitest
Comments suppressed due to low confidence (8)

src/components/Footer.test.ts:27

  • There's a typo in the comment. "assertion]" should be "assertion" without the closing bracket.
    // insert test assertion]

src/scripts/hero-action.ts:202

  • There's an extra space in the class attribute before the closing angle bracket. While this won't break functionality, it's inconsistent with standard HTML formatting. Consider removing the space: <i class="fas fa-moon"></i> instead of <i class="fas fa-moon" ></i>.
const darkModeHTML = `<i class="fas fa-moon" ></i>`

src/scripts/hero-action.ts:203

  • There's an extra space in the class attribute before the closing angle bracket. While this won't break functionality, it's inconsistent with standard HTML formatting. Consider removing the space: <i class="fas fa-sun"></i> instead of <i class="fas fa-sun" ></i>.
const lightModeHTML = `<i class="fas fa-sun" ></i>`

src/components/ModeToggleButton.astro:5

  • The toggle button is missing an accessible label. Screen readers need text to announce what this button does. Add an aria-label attribute to describe the button's purpose, such as aria-label="Toggle dark mode" or use a visually-hidden span with descriptive text.
<button class="button toggle-button" id="darkModeToggle">

src/components/Footer.astro:5

  • The footer element uses the class "hero-section" which is semantically confusing since it's not part of the hero section but rather a footer. While this reuses existing styles, it creates a maintainability issue where the class name doesn't match its purpose. Consider creating a dedicated "footer-section" class or renaming "hero-section" to something more generic like "centered-section" if it's meant to be reused.
<footer class="hero-section">

src/components/Footer.test.ts:23

  • The test description has a grammatical error. "component display" should be "component displays" (with an 's') to match standard grammar conventions.
  test("component display the correct DOM component", async () => {

src/components/ModeToggleButton.test.ts:20

  • The test only checks if the component renders with the correct class names and moon icon. Consider adding a test to verify the button has the correct ID ("darkModeToggle") since the JavaScript in hero-action.ts depends on this ID to attach the click event listener. Without this ID, the dark mode toggle functionality would break.
  test("component is rendered correctly", async () => {
    // render component
    const result = await container.renderToString(ModeToggleButton)

    // Insert test assertion
    expect(result).toContain('class="button toggle-button"')
    expect(result).toContain('class="fas fa-moon"')
  })

src/styles/global.css:479

  • The toggle button is missing display: flex in its CSS definition, but relies on the child i element having display: flex. While the icon will render correctly, the button itself should explicitly set display: flex to ensure proper alignment behavior, especially since it has align-items: center which only works on flex containers.
.toggle-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  border-radius: 100%;
  width: 40px;
  height: 40px;
  align-items: center;
  padding: 0;
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@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.

2 participants