Tell every editor which key copies, since y there types a y - #680
Merged
Conversation
#677 made `^Y` Copy in every text box. The FOOTERS only half followed: five INS strips named it, five did not, and the Fuzzer template was the pure case — it told you a ⇧arrow band could be built and then named no key that copies one, while the bare `y` the READ strip advertises is, in that mode, a literal character that REPLACES the band you just built. One keystroke, no toast, selection gone. The axis is a strip describing a mode it is not in. Six now name `⇧arrows select · ^Y copy`: Fuzzer template, Repeater gRPC, Rewriter preview INPUT, JWT INPUT-in-INS, JWT HEADER/PAYLOAD, JWT SECRET (no band — single-line field — but `^Y` still copies it). The Intercept held-bytes editor named NEITHER token, which is how it kept a registered `^Y` that nothing on screen mentioned for its whole life. On the JWT ENCODE panes and the Rewriter sample there is no READ mode at all, so `^Y` is not the convenient copy — it is the ONLY one. Those same strips advertised `space cmds`, which `edit_json`/`edit_secret` insert as a literal space; the menu that never opened was spending the one token with room to say which key copies. WHAT THE FOOTERS PROMISED, MADE TRUE. `JwtController#jwt_copy` consulted a band on one of its four editors: INPUT-in-INS copied the whole token while `jwt_selection_active?` reported the band as live (the split `RepeaterView#pane_selection?` documents), and HEADER/PAYLOAD were never asked. `jwt_clear_selection` cleared the READ model in a mode whose band lives on the editor, so the verb was a no-op exactly there. `edit_json` was the one printable arm of nine missing `report_replaced`, so typing over a band on the pane this change teaches you to build one on lost text silently. `rewriter_copy` returned without a status on an empty pane — a dead key on a pane whose `^Y` is its only copy. `↹ pane` → `↹ text` on the three Repeater INSERT arms (gRPC, split-decode, WS): `editor_captures_tab?` is `request_text_editing?`, which has no gRPC or sub-pane exclusion, so Tab splices a TAB into a header value. The plain-HTTP arm has said `↹ text` since it grew its own INSERT branch; these three shared one string across both modes and kept the READ token. Also retags ~24 comments and `it` descriptions still teaching `^Y` for the chain editor, which moved to `^Q` in #677 — now actively misleading, since `^Y` is live. GUARD: `spec/tui/editor_footer_copy_key_spec.cr`, three source-grep rules — a strip that advertises a band names a copy key; a `type …` strip does not offer `space cmds`; and every tab whose Copy verb carries `^Y` names it in a strip of its own (the file-level rule, anchored to the keymap, is the one that sees a strip saying NEITHER token — the Intercept shape a per-string rule is blind to). All three were control-run against the pre-fix strings. The third passed on its first draft because a controller's own explanatory comment contains the token, so it reads code lines only.
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.
^Ybecame Copy in every text box in #677. The footers only half followed: five INS strips named it, five did not.The Fuzzer template editor was the pure case — it told you a ⇧arrow band could be built and then named no key that copies one. The bare
yits READ strip advertises is, in that mode, a literal character that replaces the band you just built. One keystroke, no toast, selection gone. That is the bug report^Yexists to answer, and the footer is where it lands.The strips
The axis is a strip describing a mode it is not in.
type · ⇧arrows select · ^Z undo · …… select · **^Y copy** · ^Z undo · …type head/metadata · esc read · ↹ pane… · **⇧arrows select · ^Y copy** · … · ↹ texttype sample HTTP · ↑ list · …… · **⇧arrows select · ^Y copy** · …type a JWT · esc read · …… · **⇧arrows select · ^Y copy** · …type JSON · … · space cmds · …… · **⇧arrows select · ^Y copy** · …type secret · … · space cmds · …… · **^Y copy** · …(no band — single-line field)type to edit · ^R forward · …… · **⇧arrows select · ^Y copy** · …The Intercept editor named neither token, which is how it kept a registered
^Ythat nothing on screen mentioned for its whole life.On the JWT ENCODE panes and the Rewriter sample there is no READ mode at all, so
^Yis not the convenient copy — it is the only one. Those same strips advertisedspace cmds, whichedit_json/edit_secretinsert as a literal space; the menu that never opened was spending the one token with room to say which key copies.Shown in INS throughout rather than only while a band is live — matching the five strips that already did, and #677's own decision not to gate the key on a selection.
^Y copysits right after the select token so it survives an 80-column truncation.What the footers promised, made true
A strip that names a band the copy ignores is worse than one that names nothing.
jwt_copyconsulted a band on one of its four editors. INPUT-in-INS copied the whole token whilejwt_selection_active?reported the band as live — the splitRepeaterView#pane_selection?documents in its own comment. HEADER/PAYLOAD were never asked. The four sibling tabs already agreed; JWT was the outlier.jwt_clear_selectioncleared the READ model in a mode whose band lives on the editor, so the verb was a no-op exactly where this change makes bands copy-relevant.edit_jsonwas the one printable arm of nine missingreport_replaced— typing over a band on the pane this change teaches you to build one on lost text with no toast and no pointer at^Z.rewriter_copyreturned without a status on an empty pane — a dead key on a pane whose^Yis its only copy.↹ pane→↹ texton three Repeater INSERT armseditor_captures_tab?isrequest_text_editing?, which has no gRPC or sub-pane exclusion, so Tab splices a TAB into a header value. The plain-HTTP arm has said↹ textsince it grew its own INSERT branch; gRPC, split-decode and WS shared one string across both modes and kept the READ token.Also retags ~24 comments and
itdescriptions still teaching^Yfor the chain editor, which moved to^Qin #677 — now actively misleading, since^Yis live.Guard
spec/tui/editor_footer_copy_key_spec.cr, three source-grep rules:type …strip does not offerspace cmds;^Ynames it in a strip of its own.Rule 3 is anchored to the keymap rather than a hand-kept list, and is the one that sees a strip saying neither token — the Intercept shape rule 1 is structurally blind to. All three were control-run against the pre-fix strings. Rule 3 passed on its first draft because a controller's own explanatory comment contains the token, so it now reads code lines only.
These are hand-written prose strings with no compiler behind them, and the pair drifted across ten strips.
Verification
crystal spec— 8513 examples, 0 failures (the 8capture_status/project_registryfailures on this machine are a gori already holding :8070, identical before and after)crystal build --no-codegenclean;crystal tool format src specclean; no new ameba findingscopied 3bon a 3-char band; JWT HEADERcopied (6b)on a 6-char band where it would previously have said 15b; Fuzzer/JWT/Rewriter strips read as intended on screen