fix(dock): add overflow scroll + wheel/drag/fade affordances at narrow widths #76
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_os!76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_dock_scroll_affordance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the dock's horizontal-overflow affordance at narrow viewports so tiles that do not fit are reachable.
Related Issue
Closes #67
Root cause
On the web (non-mobile) target,
IDLE_CONTAINER_STYLEin crates/hero_os_app/src/components/dock.rs usedjustify-content: centerwith nooverflow-x: auto. At widths narrower than the full dock, tiles were clipped by the container with no scrollbar, no wheel mapping, and no drag affordance.Changes
crates/hero_os_app/src/components/dock.rsIDLE_CONTAINER_STYLE: addedoverflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;, switched tojustify-content: safe centerso tiles still center when the row fits but become scrollable when they do not.position: relative; scroll-behavior: smooth;to the three outer.dock-sections-scrollcontainers and the two inner conditional scroll containers (sections_container_style,islands_container_style).crates/hero_os_app/src/styles.css.dock-sections-scrollwith::before/::afterfade-edge overlays (32 px,color-mixagainstvar(--color-surface)so it themes automatically).cursor: grabgated to[data-overflow-left="true"], [data-overflow-right="true"]so the grab cursor only shows on elements that actually scroll.[data-dragging="true"]->cursor: grabbing; user-select: none;.crates/hero_os_app/src/main.rsuse_effect(guarded bywindow.__heroDockScrollInit) that installs wheel-to-horizontal scrolling, pointer drag-to-scroll (non-touch only), and keepsdata-overflow-left/data-overflow-rightattributes in sync viascroll/resize/MutationObserver. The wheel handler only callspreventDefault()when the container has real horizontal overflow, so vertical wheel on a non-overflowing dock still bubbles to the outeronwheelAI-bar toggle inhandle_dock_wheel.Test Results
cargo check --features web-platform -p hero_os_apppasses (only pre-existing warnings).make runcompletes, hero_os restarted cleanly.Note on the "arrow styling" suggestion
The issue described existing
‹/›arrows. There were none in the codebase; the only prior overflow affordance wasoverflow-x: autoon mobile only. This PR delivers three of the four "Expected" options from the issue (wheel, drag, fade-edge) and does not introduce arrow chrome.53cde36455892cccea3a