LearnNewsExamplesServices
Frontmatter
id8092
title[Refactor] Rename container.sortable to container.dragResortable
stateClosed
labels
enhancementdeveloper-experienceairefactoring
assigneestobiu
createdAtDec 11, 2025, 8:24 PM
updatedAtDec 11, 2025, 9:11 PM
githubUrlhttps://github.com/neomjs/neo/issues/8092
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 11, 2025, 8:59 PM

[Refactor] Rename container.sortable to container.dragResortable

Closed v11.17.0 enhancementdeveloper-experienceairefactoring
tobiu
tobiu commented on Dec 11, 2025, 8:24 PM

Rename sortable to dragResortable in src/container/Base.mjs and related files to disambiguate from grid data sorting. Scope:

  1. Container Base: Rename sortable_ to dragResortable_ and afterSetSortable to afterSetDragResortable in src/container/Base.mjs.
  2. Standard Extensions: Update src/dashboard/Container.mjs and src/tab/Container.mjs.
  3. Tree List: Rename sortable_ to dragResortable_ in src/tree/List.mjs.
  4. Header Toolbars (Grid/Table):
    • Rename draggable_ to dragResortable_ in src/grid/header/Toolbar.mjs and src/table/header/Toolbar.mjs.
    • Crucial: Do NOT change sortable in these files (it controls data sorting).
  5. SortZones: Update src/draggable/container/SortZone.mjs to check owner.dragResortable.
  6. Apps & Examples: Search and replace sortable: true with dragResortable: true in container configurations.
tobiu added the enhancement label on Dec 11, 2025, 8:24 PM
tobiu added the ai label on Dec 11, 2025, 8:24 PM
tobiu added the refactoring label on Dec 11, 2025, 8:24 PM
tobiu assigned to @tobiu on Dec 11, 2025, 8:25 PM
tobiu added the developer-experience label on Dec 11, 2025, 8:25 PM
tobiu referenced in commit b48f980 - "[Refactor] Rename container.sortable to container.dragResortable #8092" on Dec 11, 2025, 8:56 PM
tobiu closed this issue on Dec 11, 2025, 8:59 PM
tobiu
tobiu Dec 11, 2025, 9:11 PM

✦ I would rate the impact of this session as High.

Impact Analysis:

  • Architectural Clarity (High):

    • Disambiguation: The most critical win is separating sortable (data sorting) from dragResortable (item reordering). This resolves a confusing naming collision that was causing friction in complex components like Grids and Tables. It makes the API self-documenting.
    • Standardization: Moving the SortZone creation logic to container.Base and establishing a clear override pattern (loadSortZoneModule, createSortZone) enforces a consistent architecture across the framework.
  • Developer Experience (High):

    • Less Boilerplate: By leveraging inheritance in grid and table header toolbars, we deleted redundant imperative code. Future container extensions will be easier to write.
    • Predictability: Developers now know exactly which config controls what behavior. dragResortable is explicit.
  • Maintainability (Medium-High):

    • Centralized Logic: Fixing or enhancing the drag-and-drop initialization logic now happens in one place (container.Base), rather than being scattered across multiple afterSet... methods.
    • CSS Consolidation: Merging the toolbar animation CSS into container/SortZone.scss simplifies the theme structure.
  • Risk (Medium - Breaking Change):

    • This is a breaking change. Any existing application using sortable: true on a TabContainer, Dashboard, or generic Container for drag-and-drop will break until updated.
    • However, the migration path is trivial (search & replace), and the long-term benefit of avoiding the sortable conflict outweighs the short-term pain.

Summary: This was a necessary maturation step for the framework. As you added more complex components (Grid, Table), the overloaded sortable term became a technical debt liability. Paying it down now prevents future bugs and makes the learning curve smoother for new adopters. The code is cleaner, DRY-er, and more semantic.