Skip to content

feat(connections): drag a connection into a folder, or onto the list to leave one - #1274

Merged
ZhuchkaTriplesix merged 11 commits into
devfrom
feat/connections-drag-to-folder
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 11 commits into
devfrom
feat/connections-drag-to-folder

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Folders could only be filled by creating a connection from them, or by Move to folder in the context menu (#1270). Dragging is what people reach for.

  • Connection tiles are draggable. The copy under the pointer shows the name and the type icon; the original dims.
  • A folder is a drop target, highlighted while a connection that would change folder is over it. It opens afterwards to show what was dropped.
  • The list itself is a drop target meaning "no folder": drop on the empty part to take a connection out of its folder.
  • A drop that changes nothing (same folder, connection already at the top level) is refused.
  • Same LocalDb.setConnectionFolder as Move to folder: only folder_id changes, secrets and settings stay.

Tests: e2e drags a connection onto a folder and then onto the empty part of the list, checking the stored folder_id each time.

Test plan

  • CI: all test sections pass (no local runs, per team rule)
  • By hand on the 120 Hz build: drag onto a folder, onto another folder, out onto the list; scrolling the list and clicking a tile still work

…to leave one

Connection tiles are draggable (the dragged copy shows the name and type
icon). A folder is a drop target and is highlighted while a connection that
would change folder is over it; the list itself is a target meaning 'no
folder'. A drop that changes nothing is refused. The folder opens to show what
was dropped.

Uses the same LocalDb.setConnectionFolder as the context menu's Move to
folder.
The panel imports material with a show list; the drag widgets were not in it.
The folder's contents were looked up with folderId == _folderIdByName[name].
A folder created from the menu was added to the list of names but not to the
name-to-id map, so the lookup was folderId == null: every connection outside
a folder showed inside the new folder, and dropping on it did nothing.

- _createFolder reloads the panel data, so the id is known.
- connectionsInFolder returns nothing for an unknown id instead of matching
  the connections that have none.

The drag e2e waits for the database write after the drop.
… out of a folder

The empty part of the list was already a target for 'no folder', but nothing
says so. While a connection that lives in a folder is dragged, a labelled
strip ('Drop here to take it out of the folder') shows above the list and
highlights under the pointer. The e2e drops on it, so it no longer depends on
where the empty part of the list happens to be.
The drop writes the folder id, then the panel reloads from the database: real
I/O. The test started its next drag at once, from the old layout and with the
connection still outside the folder in the panel's state, so there was
nothing to take out and no drop strip.
…agged

The strip was a collection-if child of the panel's Column, so showing it
shifted the list below it by one slot and Flutter rebuilt the whole list,
including the tile under the pointer: the drag was dropped the moment it
started. The strip now has a fixed slot (a SizedBox when hidden).
…position

The diagnostic showed the drag did start (dragging=8) but the panel still had
the connection outside any folder (folders={8: null}). The wait checked that
the tile sat below the folder, which a top-level tile also does: folders are
listed first. It now waits until the panel's own state has the folder id.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 65d2cf0 into dev Oct 10, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the feat/connections-drag-to-folder branch October 11, 2026 15:02
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