Skip to content

feat(preview): create a secret gist from the previewed file#332

Open
jongio wants to merge 1 commit into
mainfrom
idea/preview-create-gist
Open

feat(preview): create a secret gist from the previewed file#332
jongio wants to merge 1 commit into
mainfrom
idea/preview-create-gist

Conversation

@jongio

@jongio jongio commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

Adds Ctrl+G in the preview panel to create a secret GitHub gist from the file currently shown and copy the gist URL to the clipboard.

Why

Sharing a single file usually means leaving the TUI, opening a browser, and pasting content by hand. This adds a one-key path: preview a file, press Ctrl+G, and the secret gist URL lands on your clipboard ready to share.

How

  • New github.CreateGist(ctx, path) helper runs gh gist create --secret -- <path> through the shared ghExec path. The -- separator keeps a leading-dash filename from being read as a flag.
  • New preview.createGist() handler captures the on-disk file path, creates the gist off the UI thread, copies the URL, and toasts the result.
  • The handler is a no-op for GitHub content or an empty view, matching the existing permalink guard, so it never runs against content that has no local file.
  • Wired the key in the preview dispatch, KeyBindings(), keybindings.json, and the generated docs/keybindings.md.

Testing

  • go build ./...
  • go test ./internal/panels/preview/ ./internal/github/ ./internal/keybindings/
  • go vet and gofumpt clean on touched files

Closes #326

Co-authored-by: Copilot App [email protected]

Add Ctrl+G in the preview panel to create a secret GitHub gist from the
file currently on screen and copy the gist URL to the clipboard. This is
a fast way to share a single file without leaving the TUI.

The handler is a no-op for GitHub content or an empty view, matching the
existing permalink guard. A new github.CreateGist helper shells out to
gh gist create --secret via the shared ghExec path.

Closes #326

Co-authored-by: Copilot App <[email protected]>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 13, 2026
@jongio jongio self-assigned this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open the selected file or directory on GitHub from the file tree

1 participant