Repository navigation
[CPLAT-12912] Adopt tuikit selection v2 and open URLs with o - #180
Merged
Merged
Conversation
Bump tuikit to b0beaa4 (selection v2, link, tuitest.Links/Reversed). Selection: one sel.Update call in the session TUI and the picker, with r.Offset set on the pane (not Scroll added) and AutoScrollMsg routed back, so a drag resting past a preview edge keeps scrolling. The selection's command is batched with the app's own when the event is not consumed. The ANSI-pinned highlight renderers, the hand-made copy toast text, the test reverse-video parsers and the picker's hand-computed preview inset are replaced by selection.DefaultStyle, CopiedMsg.NoteWith, tuitest.Reversed and Rect.InsetStyle. Links: PR/Jira/artifact labels in the refs preview, outputs digest, day pane, URL menu and picker are OSC 8 links. A new actions binding open_link (o) opens the session's first ref (x o) or the first URL in the selected conversation message or block (conversation x o), via link.OpenFirst; the URL menu gets o for the cursor row. o was already fold_group in the session list and jump_to_tree in the conversation, so it stays there. Existing open paths now refuse non-http(s) URLs, and the open key honors open.command_template.
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
8f65cd7 < |
2026-10-21 09:54 UTC | 0 | 0 | 0 |
Last scanned: 8f65cd7 · 2026-10-21 09:54 UTC
Kairo-Kim
approved these changes
Oct 21, 2026
mitrilmad
approved these changes
Oct 21, 2026
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.
JIRA: https://sendbird.atlassian.net/browse/CPLAT-12912
What
Follow-up to #179. tuikit goes from c19aa4f to b0beaa4. That version adds selection v2 and the
linkpackage.ccx pickpicker now make onesel.Updatecall. App-side workarounds that the kit now covers are removed. A drag that rests past a preview edge keeps scrolling (AutoScrollMsg).open_linkbinding (o) in the actions menus opens the selected item's link.Selection v2
handleSelectionMousenow callssel.Update(msg, panes, frame, now). The kit builds the panes and the frame only when the event needs them, so the hand-writtenWantsguard is gone. ThedragResizingguard stays.r.Offsetis set on the pane (viewport.SetYOffset). It is no longerScrollUp/Down(r.Scroll).selection.AutoScrollMsgis routed back to the selection in bothApp.updateandpickerModel.Update.selectionStyle/pickerSelectionStyle(renderer pinned to ANSI)selection.DefaultStyle()reportCopied/copiedNoticehand-built textCopiedMsg.NoteWith("Copied %d chars", …)(TUI keeps its capitalized toast) /CopiedMsg.Note()(picker)markSelection+highlightedreverse/mark parserstuitest.Reversed(frame)previewTextRect:X += 2; W -= 2previewRect().InsetStyle(pickerPreviewFrame). View draws the box with the same style.muesli/termenvis now indirect again.Links
xactions menux o:link.OpenFirst(refs). If the refs are not loaded yet, it reads them from the transcript offline, inside the command.refs)sendbird/ccx#5 OPEN)↵/o(kept)oand thexoutput-actionso(kept)x u)↵opens the selection. Newoopens the cursor row and keeps the menu open.xactions menux o:link.Find+link.OpenFirst("the first of N links")ccx pickpicker (urls / refs)o/↵(kept)oalready has a meaning in two contexts, so the new binding does not take it there.keys.Conflictsreports both:duplicate: "o" in session: session.fold_group, link.openandduplicate: "o" in conversation: conversation.jump_to_tree, link.open. The new action therefore lives in the actions scope, whereowas free. The fold and jump keys are unchanged.openInBrowser, the picker for urls/refs) now refuses URLs that are not http(s), such asjavascript:orfile:from a transcript. The picker still opens local paths for files, changes and images.tui.UseOpenerForLinksrouteslink.Openthroughopen.command_templatewhen one is set.main.goandrun_pick.gocall it once at startup. It is never called fromNewApp, so tests keep theirlink.Launcherstub.?overlay (x o).open_linkcan be rebound in the keymap yaml.Tests
Positions and links come from the rendered
View(). The tests stub the opener (link.Launcher,pickerOpen,a.openURL) and never run a real opener or clipboard. Tests that read config uset.Setenv("HOME", t.TempDir()).Each new guard was checked with a compiling mutation, then restored:
TestOutputsDigestLinksTitlesThatHideTheirURLTestRefsPreviewLinksLabelTestDayPaneLinksPRTitleTestURLMenuLinksLabelsAndOOpensCursorRowTestPickerURLRowLabelIsLinkedopenInBrowserwithoutlink.ValidTestRefsPreviewOpenRefusesNonHTTPURLTestPickerOpenSkipsNonHTTPURLTestPickerFilesStillOpenPathsx oopens a URL-less itemTestSessionActionsOpenLinkWithoutLinkSaysSoTestConversationActionsOpenLinkOpensFirstURLlink.FindTestConversationActionsOpenLinkOpensFirstURLlink.OpenedMsgnot shownTestSessionActionsOpenLinkOpensFirstRefopen_linkmissing from the hint boxTestOpenLinkBindingShowsInHelpr.Offsetapply (TUI)TestDragPastPreviewTopScrollsToSelectionOffset,TestDragPastPreviewBottomScrollsAndKeepsLinesr.Offset + r.ScrollTestDragPastPreviewTopScrollsToSelectionOffsetAutoScrollMsgnot routed (TUI / picker)TestDragRestingPastPreviewBottomAutoScrolls/TestPickerDragRestingPastPreviewBottomAutoScrollsr.OffsetTestPickerDragPastPreviewBottomScrollsTestPickerDragFromPreviewTowardListStaysInPreviewTwo mutations survive by design:
Reverse(true)style no longer breaks NO_COLOR.selection.Renderfalls back toDefaultStylewhen a style draws nothing.pickerPreviewFramemoves the box and the inset together. Sharing the style is the point.gofmt -lis clean.go vet ./...passes.go test ./...,go test -race ./...(one run) andenv -u LC_ALL -u LC_CTYPE LANG=ko_KR.UTF-8 go test ./...all pass.