Skip to content

Homebase v0.17.0 — Bookmark Drag Architecture Upgrade

Choose a tag to compare

@time2shine time2shine released this 08 Oct 20:10
· 40 commits to main since this release

Homebase v0.17.0

Highlights

  • Dedicated Drag Subsystem: Introduced HomebaseBookmarkDragController as the dedicated first-party bookmark drag-and-drop controller.
  • Grid Drag Extraction: Extracted SortableJS grid drag-and-drop initialization, lifecycle management, and drop processing from src/new-tab.js.
  • Folder Tab Drag Extraction: Extracted folder tab reordering, boundary index calculations, and drag styling from src/new-tab.js.
  • Monolith Complexity Reduction: Reduced src/new-tab.js by over 690 lines (~37.7% reduction during Cycle #12), removing complex event binding and state tracking.
  • Improved Maintainability: Separated drag lifecycle management from startup orchestration while preserving backward-compatible integration bridges.

Added

  • Bookmark Drag Controller Subsystem: Created src/newtab/bookmarks/bookmark-drag-controller.js to serve as canonical owner of all drag interactions.
  • Centralized SortableJS Lifecycle: Clean instantiation, destruction, class toggling, and fallback configuration for grid and folder tab sortables.
  • Dedicated Grid & Tab Drag Handling: Modular drop routing for grid reordering, moving into folders/tabs, and folder tab positioning.
  • Unified Drag State Management: Centralized isGridDragging and isTabDragging state flags with backward-compatible window accessors.
  • Raycast Pointer Tracking & Hover Locking: Extracted pointer movement raycasting with a 250ms folder hover lock to prevent tile jitter.

Improved

  • Cleaner Startup Architecture: New-tab initialization now delegates drag configuration through clean controller initialization.
  • Decoupled Architecture: Strict separation between UI rendering in �ookmark-grid-controller.js, drag physics in �ookmark-drag-controller.js, and data access in �ookmark-tree-service.js.
  • Reliable Folder Tab Reordering: Smoother tab movement animations and active tab auto-scrolling via HomebaseBookmarkTabsScroll.
  • Synchronized Virtualizer State: Virtualizer array updates (syncVirtualizerMove and
    eorderVirtualizerItems) cleanly invoke canonical methods with zero duplicate mutation logic.

Fixed

  • Nested Folder Drop Resolution: Fixed a critical subfolder drag shadowing bug where bookmark tiles dropped into subfolder tabs or back buttons referenced stale root parent nodes.
  • Subfolder Drag Targeting: Replaced static folder variable references with dynamic getCurrentGridFolderNode() queries.
  • Dead Code & Comment Cleanup: Removed obsolete manual HTML5 drag listeners and historical comments from setupBookmarksFolderView().

Technical Notes

  • src/new-tab.js: 1,842 lines → 1,148 lines (-694 lines net).
  • New Subsystem: src/newtab/bookmarks/bookmark-drag-controller.js (823 lines).
  • Static Invariant Verification: PASS (63 deferred local scripts, 894 unique declarations, 0 collisions).
  • Automated Test Suite: PASS (367 / 367 unit tests passing on
    ode:test).
  • Browser Smoke Test: PASS (Chromium/Edge headless runtime verification, zero console errors).
  • Extension Builds:
    • Chrome MV3: PASS (dist/chrome/)
    • Firefox MV3: PASS (dist/firefox/)