Skip to content

Feature/drag to reorder applets#590

Open
boloto1979 wants to merge 2 commits into
pop-os:masterfrom
boloto1979:feature/drag-to-reorder-applets
Open

Feature/drag to reorder applets#590
boloto1979 wants to merge 2 commits into
pop-os:masterfrom
boloto1979:feature/drag-to-reorder-applets

Conversation

@boloto1979
Copy link
Copy Markdown

@boloto1979 boloto1979 commented Apr 25, 2026

Summary

Implements drag-to-reorder for applets in the COSMIC panel, similar to
the long-press reorder in macOS menu bar.

Behavior

  • Hold an applet for 400 ms to enter drag mode
  • While dragging, other applets slide smoothly to show a live preview
    of the new position (ease-out-cubic animation, 180 ms)
  • Release to commit the new order; it is persisted immediately via
    cosmic-config without restarting the panel
  • A short click (< 400 ms) behaves exactly as before — popups open
    normally

Changes

  • panel_space.rs: AppletDragState, DragSection, DRAG_LONG_PRESS_MS,
    find_applet_for_surface(), update_drag_preview(), commit_drag_reorder()

  • wrapper_space.rs: long-press detection in update_pointer(),
    drag start/commit in handle_button(), press suppression via
    is_pending_drag() to prevent popups from opening during drag

  • layout.rs: temporary reorder during drag preview + slide animation

  • main.rs: PanelCalloopMsg::ReorderPlugins to persist order without
    triggering a panel restart

  • I have disclosed use of any AI generated code in my commit messages.

    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.

  • My change is accurately described in the commit message.

  • My contribution is tested and working as described.

  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

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.

1 participant