Skip to content

feat(holocene): add VerticalNav component#2924

Merged
rossnelson merged 5 commits into
mainfrom
holocene-vertical-nav
Sep 24, 2025
Merged

feat(holocene): add VerticalNav component#2924
rossnelson merged 5 commits into
mainfrom
holocene-vertical-nav

Conversation

@rossnelson

@rossnelson rossnelson commented Sep 24, 2025

Copy link
Copy Markdown
Collaborator

Overview

Add a VerticalNav component to the Holocene design system for use in settings layouts and other navigation contexts.

CleanShot 2025-09-24 at 14 14 03

Behavioral Details

Active Item Background

  • Static background that follows the currently active/selected item
  • Smooth transition when active item changes via click
  • Uses bg-interactive-secondary-active color

Hover Background

  • Shows bg-interactive-secondary-hover on non-active items
  • Initial hover: Fades in without position animation
  • Subsequent hovers: Smoothly animates between items
  • After click: Background is hidden, then appears fresh on next hover (no animation from old position)
  • Active item hover: No hover background shown (active takes precedence)
  • Mouse leave: 100ms delay before hiding with fade out

Animation States

  • hideHoverBackground: Removes hover element from DOM after clicks
  • enableTransitions: Controls whether position animations are applied
  • hoverTimeout: Manages delayed hide on mouse leave

Implementation Notes

  • Uses Svelte 5 runes ($state, $derived.by, minimal $effect)
  • Context API for parent-child communication
  • Functional programming patterns with guard statements (no nested if/else)
  • DOM element registration for position tracking
  • Dual background system for independent active/hover states

Component Structure

  • vertical-nav.svelte: Container managing backgrounds and state
  • vertical-nav-item.svelte: Individual nav items with click/hover handlers
  • vertical-nav.stories.svelte: Storybook examples including interactive demo

Testing

Test the component in Storybook with various scenarios:

  • Static navigation
  • Interactive item switching
  • Disabled items
  • With/without descriptions
  • Leading/trailing icons
  • Content panel integration

Implements a new vertical navigation component for Holocene design system with:
- Dual background system (static active, animated hover)
- Smart debouncing for smooth transitions
- Full accessibility support with ARIA attributes
- Svelte 5 reactive patterns using runes
- TypeScript strict typing throughout
- Comprehensive Storybook documentation
@vercel

vercel Bot commented Sep 24, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
holocene Ready Ready Preview Comment Sep 24, 2025 6:08pm

Replaced  usage with .by() for calculating background
positions and styles. This eliminates side effects in favor of reactive
derived state, following team preferences.

Only 2 effects remain:
- Prop sync (unavoidable for activeItemId sync)
- Cleanup (unavoidable for timeout cleanup on unmount)
Enhanced transition reset logic for consistent fade-in animations:
- Resets when hovering active item (no hover background shown)
- Resets after clicking any item
- Resets when mouse leaves navigation
- Ensures smooth fade-in whenever starting to hover non-active items
@rossnelson
rossnelson marked this pull request as ready for review September 24, 2025 16:49
@rossnelson
rossnelson marked this pull request as draft September 24, 2025 16:54
- Use functional patterns with guard statements (no nested if/else)
- Hide hover background completely on click (remove from DOM)
- Show fresh without animation on first hover after click
- Enable smooth transitions only between subsequent hovers
- Conditionally render hover element to ensure clean state
- Separate opacity control from position animations
- Fade-in on first hover (opacity transition only)
- Full animation (position + opacity) on subsequent hovers
- Reset and fade fresh after clicking items
@rossnelson
rossnelson marked this pull request as ready for review September 24, 2025 18:15
@rossnelson
rossnelson requested a review from a team as a code owner September 24, 2025 18:15
@rossnelson
rossnelson merged commit b809fb5 into main Sep 24, 2025
15 checks passed
@rossnelson
rossnelson deleted the holocene-vertical-nav branch September 24, 2025 19:43
temporal-cicd Bot pushed a commit that referenced this pull request Oct 8, 2025
Auto-generated version bump from 2.40.1 to 2.41.0

Bump type: minor

Changes included:
- [`904ca347`](904ca34) fix(workflows): add GitHub App token to version bump PR creation (#2910)
- [`bd50889e`](bd50889) fix(workflows): fix changelog generation and PR body formatting in version bump (#2912)
- [`ce91ecf6`](ce91ecf) style: fix formatting in version-bump workflow (#2914)
- [`352e9f66`](352e9f6) ci(workflows): add path filter to trigger-downstream-updates (#2916)
- [`9e39fa81`](9e39fa8) Add test sentence in README.
- [`68f75a20`](68f75a2) Remove test sentence
- [`73c83894`](73c8389) Start Delay UI improvements (#2907)
- [`f7924cd0`](f7924cd) Fix issue with localActivity decoding with Java sdk (#2921)
- [`474091aa`](474091a) add switch icon (#2895)
- [`a6ec2611`](a6ec261) remove monaco in favor of codemirror (#2920)
- [`b0042390`](b004239) Add quotes around allowOrigins (#2923)
- [`b809fb51`](b809fb5) feat(holocene): add VerticalNav component (#2924)
- [`e72ca8ac`](e72ca8a) Try adding overflow css to codemirror (#2929)
- [`9c472385`](9c47238) add change event to dark mode in top nav (#2930)
- [`bb750c9c`](bb750c9) fix(security): remediate command injection vulnerabilities in GitHub Actions (#2932)
- [`e54f3dc9`](e54f3dc) Add try catch around decodeForSvelte on bad params (#2934)
- [`cfc4998c`](cfc4998) replace v5 with crypto.randomuuid (#2927)
- [`a47970e9`](a47970e) Fix NaN in Batch Operations results (#2938)
- [`6cb24dec`](6cb24de) Migrate layout files to Svelte 5 (#2937)
- [`f424f03d`](f424f03) Bump tar-fs from 3.0.9 to 3.1.1 (#2926)
- [`3255f31d`](3255f31) Saved Workflow Query Views (#2931)
Alex-Tideman added a commit that referenced this pull request Oct 8, 2025
Auto-generated version bump from 2.40.1 to 2.41.0

Bump type: minor

Changes included:
- [`904ca347`](904ca34) fix(workflows): add GitHub App token to version bump PR creation (#2910)
- [`bd50889e`](bd50889) fix(workflows): fix changelog generation and PR body formatting in version bump (#2912)
- [`ce91ecf6`](ce91ecf) style: fix formatting in version-bump workflow (#2914)
- [`352e9f66`](352e9f6) ci(workflows): add path filter to trigger-downstream-updates (#2916)
- [`9e39fa81`](9e39fa8) Add test sentence in README.
- [`68f75a20`](68f75a2) Remove test sentence
- [`73c83894`](73c8389) Start Delay UI improvements (#2907)
- [`f7924cd0`](f7924cd) Fix issue with localActivity decoding with Java sdk (#2921)
- [`474091aa`](474091a) add switch icon (#2895)
- [`a6ec2611`](a6ec261) remove monaco in favor of codemirror (#2920)
- [`b0042390`](b004239) Add quotes around allowOrigins (#2923)
- [`b809fb51`](b809fb5) feat(holocene): add VerticalNav component (#2924)
- [`e72ca8ac`](e72ca8a) Try adding overflow css to codemirror (#2929)
- [`9c472385`](9c47238) add change event to dark mode in top nav (#2930)
- [`bb750c9c`](bb750c9) fix(security): remediate command injection vulnerabilities in GitHub Actions (#2932)
- [`e54f3dc9`](e54f3dc) Add try catch around decodeForSvelte on bad params (#2934)
- [`cfc4998c`](cfc4998) replace v5 with crypto.randomuuid (#2927)
- [`a47970e9`](a47970e) Fix NaN in Batch Operations results (#2938)
- [`6cb24dec`](6cb24de) Migrate layout files to Svelte 5 (#2937)
- [`f424f03d`](f424f03) Bump tar-fs from 3.0.9 to 3.1.1 (#2926)
- [`3255f31d`](3255f31) Saved Workflow Query Views (#2931)

Co-authored-by: Alex-Tideman <[email protected]>
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