Skip to content

feat: floating action button with scroll-to-top and expandable sub-actions - #98

Merged
kenjdavidson merged 3 commits into
mainfrom
copilot/add-floating-action-button
Mar 15, 2026
Merged

feat: floating action button with scroll-to-top and expandable sub-actions#98
kenjdavidson merged 3 commits into
mainfrom
copilot/add-floating-action-button

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor
  • Create FloatingActionButton.tsx React component with:
    • Main button (scroll-to-top) visible after scroll threshold (300 px default)
    • Up to 6 configurable sub-action buttons at clock positions 1, 3, 5, 7, 9, 11
    • Sub-buttons appear on hover, spread at correct clock-face angles
    • Mouse leave delay (100 ms) so cursor can travel to sub-buttons without collapse
    • Timer cleanup on unmount to prevent state updates on unmounted component
    • aria-hidden when FAB is not visible (screen reader accessibility)
    • Keyboard accessibility (focus-visible rings)
    • Dark mode support via Tailwind brand colors
  • Add FloatingActionButton to BaseLayout.astro with client:idle and Home + About sub-actions
  • Reduce orbit radius from 72 px → 58 px so sub-buttons sit closer to the main button
  • Build verified, CodeQL clean (0 alerts)
  • Before/after screenshots captured and embedded below

Screenshots

Before

No FAB present — bottom-right corner is empty when scrolled.

Before — scrolled, no FAB

After — FAB visible (scrolled down)

Teal circular button with an up-arrow appears at the bottom-right once the page is scrolled past 300 px.

After — FAB visible

After — FAB expanded on hover (light mode)

Sub-buttons now orbit at 58 px — sitting close to the main button.

After — FAB expanded light mode

After — FAB expanded on hover (dark mode)

After — FAB expanded dark mode

Original prompt

This section details on the original issue you should resolve

<issue_title>Floating action button - return to top</issue_title>
<issue_description>Would like a floating action button in the bottom right, that is visible when the page is scrolled down, it will contain an up arrow icon and will send the user to the top of the page.

I'd like to actually have the ability to extend so that we can add smaller buttons to it. For example you can click it, but if you just hover over it, buttons will appear around its circumference. These will be smaller (maybe 2/3 the size) and will provide other links that might be usefull, for example, there could be to buttons for home and about, starting. They should be spread consistently around, assuming a max of 6 possible buttons.

Which means hte larger FAB could have 6 buttons at 1, 3, 5, 7, 9 and 11 if you were looking at a clock. </issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…b-actions

Co-authored-by: kenjdavidson <6210735+kenjdavidson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add floating action button for return to top navigation feat: floating action button with scroll-to-top and expandable sub-actions Mar 14, 2026
Copilot AI requested a review from kenjdavidson March 14, 2026 22:28
@kenjdavidson
kenjdavidson marked this pull request as ready for review March 15, 2026 04:02
@kenjdavidson

Copy link
Copy Markdown
Owner

@copilot are you forgetting something? From your instructions? Something you're supposed to provide on UI changes?

Copilot AI commented Mar 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot are you forgetting something? From your instructions? Something you're supposed to provide on UI changes?

Sorry about that! The PR description has been updated with the required before/after screenshots:

  • Before — scrolled page with no FAB present in the bottom-right corner
  • After (light mode) — FAB visible when scrolled, and sub-buttons (Home at 11 o'clock, About at 9 o'clock) fanned out on hover
  • After (dark mode) — same behaviour using the existing brand-* colour tokens

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@kenjdavidson

Copy link
Copy Markdown
Owner

@copilot based on the screenshots, I'd like the auxiliary buttons to be a little closer to the main button.

Co-authored-by: kenjdavidson <6210735+kenjdavidson@users.noreply.github.com>

Copilot AI commented Mar 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot based on the screenshots, I'd like the auxiliary buttons to be a little closer to the main button.

Done in cc58369 — reduced ORBIT_RADIUS from 72 px to 58 px so the sub-buttons sit much closer to the main button.

FAB expanded — closer sub-buttons (light)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/kenjdavidson.github.io/kenjdavidson.github.io/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

Floating action button - return to top

2 participants