feat: rework clip catalog (group paste, folder metadata, panel polish)#215
Open
fuzzzerd wants to merge 6 commits into
Open
feat: rework clip catalog (group paste, folder metadata, panel polish)#215fuzzzerd wants to merge 6 commits into
fuzzzerd wants to merge 6 commits into
Conversation
Pastes whose root contains <Group> elements now expand into one clip per <Script>, mirroring the Group hierarchy as FolderPath segments. Loose scripts paste at the currently selected clip's folder; Groups nest beneath it. Folder name collisions merge into the existing folder.
- Add FolderData with FileMaker Group attributes (id, includeInMenu, groupCollapsed) - Extend IClipRepository with LoadFoldersAsync/SaveFoldersAsync (default-implemented) - Persist folders as .sharpfm-folder.json sidecars; empty folders survive saves - Capture Group attributes when decomposing a paste; carry forward through the host - Track folder selection in the tree so new clip/folder/paste land in the targeted folder - Add New Folder command to the File menu and tree context menu
Names containing '/', ':', or other reserved characters now round-trip cleanly through the local file-system repository instead of failing the save with a DirectoryNotFoundException or losing folder segments to sanitization.
- Tree context menu mirrors the File/Edit commands so New / Paste / Copy / Rename / Delete work consistently regardless of how the menu was opened - New Script creates a whole-script clip (Mac-XMSC); New Script Steps creates a bare step list (Mac-XMSS), matching the existing Copy-as-... split - Tapping a folder leaves the active editor tab alone; right-clicking empty tree area targets the repository root - New Folder no longer auto-selects the just-created folder, so successive invocations produce siblings instead of nesting
The clip tree now fills the entire left panel via DockPanel layout so empty space below the last node is a valid right-click target for root operations. A single synthetic root node (labeled after the repo's leaf folder) wraps the top-level items, giving root-targeted actions an explicit click target regardless of how much content fills the panel.
The clip tree's IsExpanded property on the VM was never wired to the container, so every RebuildTree triggered by a new clip, paste, or folder operation collapsed the tree back to Avalonia's default. A two-way style setter on TreeViewItem.IsExpanded honours the VM (default true) and routes chevron clicks back to it.
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
Reworks how the clip catalog ingests, stores, and presents script and table clips. The branch grew from the original
Grouppaste task into a broader catalog overhaul because the dependencies surfaced as I went; everything below either supports or builds on the Group-paste flow.Closes #206
What's in here
Clip ingestion
<Script>and<BaseTable>clips now adopt their FileMaker-side name automatically — no morenew-clipplaceholders when the source XML already carries a name.Groups decompose into one clip per<Script>, mirroring the Group hierarchy as folders. Loose scripts at the snippet root share the paste root; nested Groups produce nested folders. Single-clip paste behaviour is unchanged.id,includeInMenu,groupCollapsed) are captured on paste and persisted alongside the folder.Catalog persistence
FolderDatarecord andIClipRepository.LoadFoldersAsync/SaveFoldersAsync(default-implemented) let the catalog track folder metadata independent of any clip living in the folder. Existing plugin repositories compile unchanged..sharpfm-folder.jsonsidecar per materialised folder. An "empty folder" is a directory that contains only the sidecar; orphan sweeps now respect both clips and folder markers./,:,\, etc.) are percent-encoded on the way down and decoded on the way back, so a FileMaker script literally namedGo-To-Record/Request/Pageround-trips cleanly instead of crashing the save.(2),(3), …. Folder-name collisions merge into the existing folder.Catalog UX
TargetFolderPath: new clip / paste / new folder land at the explicitly tapped folder, falling through to the selected clip's folder, then to root. Tapping a folder no longer closes the active editor tab.Mac-XMSC); a sibling "New Script Steps" command creates the bare step list (Mac-XMSS), matching the existing Copy-as-... split.IsExpanded(default true), so rebuilds triggered by create / paste / rename leave the tree expanded instead of collapsing it.Carry-forward
IncludeInMenu/GroupCollapsedon existing folders yet — the data is persisted but only changed by re-pasting from FileMaker.