tui: fast-copy keybinds for selected node hierarchy (y/Y)#2
Merged
Conversation
Adds two clipboard shortcuts to plnk-tui for handing the currently
selected node off to an AI agent (or paste target) without retyping IDs:
y copy compact JSON of the selection's ID hierarchy
Y copy a paste-ready `plnk <resource> snapshot --output json`
command preceded by a breadcrumb comment
Both write to the system clipboard via the OSC 52 escape sequence, so
the feature works locally, inside tmux (with `set -g set-clipboard on`),
and over SSH without pulling in a native clipboard dependency.
Selection types handled: project, board, list, card, grouped card, and
label group (resolves to its underlying list).
Project, board, list, and card names are user-editable on the Planka
server. Control characters are stripped from the breadcrumb embedded in
the shell command form to prevent newline injection from breaking out
of the leading `#` comment line on paste. The JSON form is unaffected
because serde_json escapes control characters by definition.
Includes 13 unit tests covering RFC 4648 base64 vectors, all six
TreeKey variants, JSON escaping, and control-character sanitization.
Docs:
docs/tui/fast-copy.md new feature page
docs/tui/keybindings.md y/Y rows under Global
docs/tui/overview.md feature bullet + cross-link
README.md one-liner + docs link
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
Adds two clipboard shortcuts to
plnk-tuifor handing the currently selected node off to an AI agent (or any paste target) without retyping IDs.yid+name)Yplnk <resource> snapshot --output jsoncommand, preceded by a breadcrumb commentBoth keys write to the system clipboard via the OSC 52 escape sequence. No native clipboard dependency — works locally, inside tmux (with
set -g set-clipboard on), and over SSH.Handles all six
TreeKeyvariants: project, board, list, card, grouped card, and label group (which resolves to its underlying list).Security
Project / board / list / card names are user-editable on the Planka server. A name containing
\nwould otherwise break out of the leading#comment line in theYoutput and put attacker-controlled text on its own line — executable on shell paste. The breadcrumb embedded in the shell command form has all control characters (C0, DEL, C1) stripped viachar::is_control(), replaced with a single space. The JSON form is unaffected becauseserde_jsonescapes control characters by definition.Test plan
cargo test -p plnk-tui— 13 new unit tests passTreeKeyvariants resolve correctly",\\,\n\r,\x1b(ANSI escape),\x00stripped from breadcrumbcargo test— all 144+ workspace tests passcargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleanplnk-tui, select a card, pressy, paste — confirm JSON arrives on clipboardY— confirm breadcrumb + snapshot command arrivesDocs
docs/tui/fast-copy.md— new feature page (formats, OSC 52 mechanism, terminal compatibility table, security model)docs/tui/keybindings.md—y/Yrows under Globaldocs/tui/overview.md— feature bullet + cross-linkREADME.md— one-liner + docs link