Skip to content

Conversation

@PrayagCodes
Copy link

Summary

This pull request transforms the top toolbar into a centered floating island design with intelligent auto-hide functionality. The implementation provides users with increased screen real estate and a modern interface while maintaining full toolbar functionality.

Closes Feature

Closes Issue #4 - Implement dynamic top toolbar#8

Changes

Visual Design Updates

  • Toolbar is now horizontally centered at the top of the screen
  • Implements island design with auto-width and 20px border-radius
  • Positioned 10px from top edge with floating shadow effect
  • Button spacing updated to 5px gap with 15px horizontal padding
  • Logo margin removed to support centered layout

Auto-Hide Implementation

  • Automatically hides after 2 seconds of mouse inactivity
  • Reveals when mouse cursor moves within 50px of screen top
  • Implements peek mode with 60% opacity on mouse proximity
  • Adjusts desktop and window layout when toolbar visibility changes
  • Includes settings toggle in Personalization tab
  • Synchronizes preferences between localStorage and KV store with fallback

Technical Architecture

  • Class-based ToolbarAutoHide singleton for state management
  • CSS animation states: toolbar-visible, toolbar-hidden, toolbar-peek
  • Combined CSS transforms maintain horizontal centering during animations
  • Implements error handling with graceful fallback mechanisms
  • Includes double-initialization protection
  • Self-contained preference loading without external dependencies

Detailed Changes by File

src/gui/src/css/style.css

  • Added centered island toolbar styles
  • Implemented auto-hide animation states
  • Added toggle switch component styles

src/gui/src/helpers/toolbar_autohide.js

  • New file containing ToolbarAutoHide class
  • State management and animation logic
  • Preference loading and synchronization
  • Mouse proximity detection

src/gui/src/UI/UIDesktop.js

  • Removed logo margin-right auto property
  • Integrated auto-hide initialization

src/gui/src/UI/Settings/UITabPersonalization.js

  • Added auto-hide toggle switch control
  • Implemented preference load/save handlers

src/gui/src/globals.js

  • Added toolbar_autohide default preference (false)

  Transform toolbar into a modern centered island design with smart
  auto-hide functionality for maximizing workspace.

  Features:
  - Centered floating toolbar (macOS-style)
  - Auto-hide after 2 seconds of inactivity
  - Reveals on mouse proximity to top edge
  - Settings toggle in Personalization
  - Smooth animations and peek mode
  - Automatic layout adjustments

  Technical:
  - Class-based ToolbarAutoHide singleton
  - CSS transform states for animations
  - Preference sync (localStorage + KV store)
  - Self-contained with error handling
@PrayagCodes PrayagCodes changed the title feat: centered floating toolbar with auto-hide functionality feat: Centered floating toolbar with auto-hide functionality Nov 17, 2025

// Load the current state from KV store and set checkbox
puter.kv.get('user_preferences.toolbar_autohide').then(async (val) => {
const isEnabled = val === true || val === 'true';
Copy link

@israx israx Nov 18, 2025

Choose a reason for hiding this comment

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

when would be the case when val is a string?

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.

Issue #4 - Implement dynamic top toolbar

2 participants