Repository navigation
feat(connections): drag a connection into a folder, or onto the list to leave one - #1274
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
LocalDb.setConnectionFolderas Move to folder: onlyfolder_idchanges, 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_ideach time.Test plan