Skip to content

feat: add plugin architecture with bidirectional clip sync#150

Merged
fuzzzerd merged 2 commits into
fuzzz/update-readmefrom
fuzzz/plugin-architecture
Apr 2, 2026
Merged

feat: add plugin architecture with bidirectional clip sync#150
fuzzzerd merged 2 commits into
fuzzz/update-readmefrom
fuzzz/plugin-architecture

Conversation

@fuzzzerd
Copy link
Copy Markdown
Owner

@fuzzzerd fuzzzerd commented Apr 2, 2026

Summary

  • Add extensible plugin system with GPL plugin exception clause permitting non-GPL plugins
  • Introduce IClipEditor abstraction for clip-type-agnostic bidirectional sync between structured editors and plugins
  • Reorganize menu into File/Edit/Plugins with version in status bar

Plugin Architecture

  • SharpFM.Plugin contract library: IPanelPlugin, IPluginHost, IClipEditor, PluginKeyBinding, PluginMenuAction
  • Plugin discovery and loading from plugins/ directory at runtime
  • Plugin Manager UI for install from file and removal
  • Keyboard shortcut registration and custom menu actions for plugins
  • Two bundled plugins: Clip Inspector (sample) and XML Viewer (replaces built-in)

Bidirectional Sync

  • IClipEditor interface with ScriptClipEditor, TableClipEditor, FallbackXmlEditor implementations
  • Each editor handles its own debounced change detection (500ms)
  • Generation counter prevents editor-host sync loops (zero cost, monotonic)
  • Origin tagging on ClipContentChanged events enables multi-plugin coordination
  • FmField now implements INotifyPropertyChanged for live table editor tracking
  • Table FromXml uses diff/patch to preserve UI state (selection, scroll)

Menu Reorganization

  • File: New Script, New Table, Open Folder, Save All, Exit
  • Edit: Paste from FileMaker, Copy to FileMaker, Copy as C# Class
  • Plugins: loaded plugins with keyboard shortcuts, Manage Plugins...
  • Version moved to status bar

Test plan

  • 198 tests pass (dotnet test)
  • Script clip: edit in script editor -> XML viewer updates. Edit XML -> script updates.
  • Table clip: add/edit field -> XML viewer updates. Edit XML -> table patches.
  • Fallback clip: bidirectional XML sync
  • Plugins menu lists loaded plugins with gesture hints
  • Manage Plugins dialog: install from file, remove
  • App runs fine with empty plugins/ directory

fuzzzerd added 2 commits April 1, 2026 18:10
Add extensible plugin system with GPL plugin exception clause:
- SharpFM.Plugin contract library (IPanelPlugin, IPluginHost, IClipEditor)
- Plugin discovery/loading from plugins/ directory
- Plugin Manager UI for install/remove
- Keyboard shortcut registration for plugins

Introduce IClipEditor abstraction for clip-type-agnostic bidirectional
sync between structured editors and plugins:
- ScriptClipEditor, TableClipEditor, FallbackXmlEditor implementations
- Generation counter prevents editor↔host sync loops
- Origin tagging on ClipContentChanged enables multi-plugin coordination
- Debounced change detection (500ms) for all editor types

Add FmField INotifyPropertyChanged for live table editor tracking.
Refactor ClipViewModel to delegate all sync to IClipEditor.

Include two bundled plugins:
- Clip Inspector (sample/demo plugin)
- XML Viewer (replaces built-in XML window, Ctrl+Shift+X)
Flatten File menu (no nested New/Save submenus), add Edit menu for
clipboard operations, replace View with dedicated Plugins menu. Move
version display from menu bar to status bar.

Add PluginMenuAction API so plugins can register custom menu items.
Plugins with no custom actions show as a flat toggle item; plugins with
actions get a submenu with Toggle Panel plus their custom entries.
@fuzzzerd fuzzzerd merged commit 83f3d32 into fuzzz/update-readme Apr 2, 2026
3 checks passed
@fuzzzerd fuzzzerd deleted the fuzzz/plugin-architecture branch April 2, 2026 01:46
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