Add "Publish to Gist" to Notes plugin
Details
One-click publishing of Notes pages as GitHub Gists. Converts the page to
markdown using the existing export infrastructure, creates a secret gist via
the GitHub API, and copies the gist URL to the clipboard.
Accessible from:
- Export dropdown in page toolbar (Export → GitHub Gist)
- Right-click context menu on page tree (Publish to Gist)
Uses the existing GitHub connection (Notes already implements IConnectionConsumer
with repo scope). No new dependencies or schema changes needed.
New files:
- GistPublishService.cs: lightweight HTTP client for POST /gists only
Fix gist push to handle title/filename renames
Details
PushSnippetAsync now detects when the snippet title has changed (producing a
different filename via BuildFilename) and sends a rename payload to the GitHub
API: deletes the old filename (null) and creates the new filename with content.
UpdateGistAsync gains a rawFiles parameter (Dictionary<string, object?>) to
support null values for file deletion, which is how the GitHub API expresses
file renames.
Auto-push to gist on save when bidirectional sync is enabled
Details
When a snippet is linked to a gist source with sync_direction="bidirectional",
saving the snippet now automatically pushes the changes to GitHub. If the push
fails, the local save still succeeds and the user is notified of the push failure.
Full-featured GitHub Gists integration for Snippets plugin (v1.9.0)
Details
Adds bidirectional gist sync and full gist management capabilities:
Models:
- GistSource: add sync_direction, remote_updated_at, html_url, is_starred, is_own
- Snippet: add gist_content_hash for dirty detection via SHA256
GitHubGistApiClient:
- Add CreateGistAsync, UpdateGistAsync, DeleteGistAsync for write operations
- Add StarGistAsync, UnstarGistAsync, IsGistStarredAsync for star management
- Add html_url field to GitHubGist DTO
GistSyncService:
- Refactor SyncAsync to branch on sync_direction (pull_only vs bidirectional)
- Bidirectional: compare content hashes (local dirty) and timestamps (remote dirty),
push local changes, pull remote changes, remote wins on conflict
- Add PublishSnippetAsGistAsync: create gist, link snippet, set up collection
- Add PushSnippetAsync: push local edits to GitHub
- Add DeleteGistAsync: delete from GitHub, unlink snippets
- Add RenameGistAsync: update gist description on GitHub
- Add ToggleStarAsync: star/unstar with local state persistence
GistSourcesViewModel (overlay):
- Add ToggleStar, StartRename/ConfirmRename/CancelRename, DeleteGistFromGitHub
- Add OpenInBrowser, CopyEmbedCode, ToggleSyncDirection commands
- GistSourceEntry: add IsStarred, IsOwn, SyncDirection, IsRenaming, EditName, HtmlUrl
- Ownership gating: rename/delete only available for owned gists
- Populate new fields in LoadSourcesAsync and AddSelectedGistAsync
SnippetsViewModel (detail panel):
- Add SelectedSnippetGistSource, IsGistLinked computed property
- Add publish dialog state: IsPublishingGist, PublishGistDescription, PublishGistIsPublic
- Add ShowPublishGistDialog, CancelPublishGist, ConfirmPublishGistAsync commands
- Add PushToGistAsync, CopyGistEmbedCodeAsync, OpenGistInBrowser commands
GistSourcesOverlay.axaml:
- Replace remove button with three-dot MenuFlyout (Open, Embed, Rename, Delete, Remove)
- Add star toggle button on source cards
- Add sync direction toggle (pull_only ↔ bidirectional) as clickable label
- Add inline rename with TextBox swap + confirm/cancel buttons
SnippetsView.axaml:
- Add "gist" text badge next to language badge for gist-linked snippets
- Add Push, Embed, Open in Browser icon buttons for gist-linked snippets
- Add Publish button with GitHub icon for unlinked snippets
- Add inline publish panel with description, public/secret toggle, publish/cancel
SnippetsPlugin.cs:
- Add sync_direction indexed field to gist_source schema
- Bump version 1.8.0 → 1.9.0 (csproj + Metadata)
- Update DetailedDescription to mention bidirectional gist sync
Add GitHub Gists integration to Snippets plugin (v1.8.0)
Details
Pull-only sync from GitHub Gists into local snippets. Each gist file
becomes a snippet, auto-grouped into a collection named after the gist
description. Follows the Notes plugin's Wiki Sources pattern.
New files:
- GistSource model with sync status tracking
- GitHubGistApiClient (paginated list + single-gist fetch)
- GistSourceService (SDK CRUD wrapper for gist_source entities)
- GistSyncService (orchestrates pull sync with file diffing)
- GistSourcesViewModel (overlay state machine with add/sync/remove)
- GistSourcesOverlay (modal UI using shared adaptive:ModalOverlay)
Modified files:
- Snippet: added gist_source_id and gist_filename tracking fields
- SnippetsPlugin: IConnectionConsumer (gist scope), gist_source entity
schema, service wiring, WipeTargets
- SnippetsViewModel: lazy GistSourcesViewModel, OpenGistSources command
- SnippetsView: gear icon with MenuFlyout, overlay embedding
- csproj: version bump 1.7.6 → 1.8.0
Get notified about new releases