orkmode/ui/src
Levi Neely b329bcebd0 Support cross-file refile via spring-loaded drag
Dragging a section's grip can now drop it into another file: hover the
drag over a document in the sidebar for ~450ms and the view springs to
that file, after which the normal in-file drop chooses the exact
position. The subtree is removed from the source file and inserted in the
target (reparented, re-leveled, and placed before the chosen sibling).

The key change is making the drag scene-level so it survives the view
switching files mid-drag:

Model (decouple source from view):
- beginDrag(row) captures (sourceDoc, sourceId) by value; dragSourceDoc()/
  dragSourceId() expose them for the drag payload.
- resolveDrop(gapAboveRow, desiredLevel) resolves against the current view
  and excludes the dragged subtree only when it lives in the current file
  (so cross-file drags, whose source isn't present, exclude nothing).
- commitDrag(parentId, beforeId) issues refile <sourceDoc> <id> <curDoc>
  … so it targets whatever file is now shown; endDrag() clears state.
- Drops the old row-indexed refileSection/resolveDrop.

GUI:
- OutlineView: the grip starts a Qt Automatic (scene) drag on an invisible
  proxy carrying the section payload (keys ["ork-section"]); a DropArea
  over the outline resolves the live position and commits on drop. Because
  the drag is scene-level, springing the view no longer cancels it.
- Main.qml: each sidebar document is a DropArea with a 450ms spring Timer
  that selects that document when a section is held over it; it highlights
  while a drag hovers.

Verified: cross-file refile over 9P (refile src mover tgt two child) moves
the subtree between files, re-levels it, inserts before the sibling, and
carries its body. Server tests still green. GUI builds clean.

The scene-drag gesture and spring timing can't be verified headlessly;
the data path (begin/resolve/commit + cross-doc refile) is confirmed.
2026-10-05 09:35:34 +02:00
..
documentmodel.cpp Support cross-file refile via spring-loaded drag 2026-10-05 09:35:34 +02:00
documentmodel.h Support cross-file refile via spring-loaded drag 2026-10-05 09:35:34 +02:00
main.cpp Fix system theme consistency 2026-10-01 09:15:31 +02:00
orkclient.cpp Add an org path setting with a directory picker to Settings 2026-10-02 12:11:19 +02:00
orkclient.h Add an org path setting with a directory picker to Settings 2026-10-02 12:11:19 +02:00
p9client.cpp Add v0.3 read-only Qt6/QML GUI (9P client) 2026-10-01 02:02:53 +02:00
p9client.h Add v0.3 read-only Qt6/QML GUI (9P client) 2026-10-01 02:02:53 +02:00
thememanager.cpp Fix system theme consistency 2026-10-01 09:15:31 +02:00
thememanager.h Fix system theme consistency 2026-10-01 09:15:31 +02:00