Skip to content

Conversation

@mitchellh
Copy link
Contributor

Fixes #189

This adds the UI for search to GTK. There is still polish to be done in follow-ups but this makes search work well with GTK to start!

AI disclosure: Believe it or not, almost this entire PR was AI-written. Amp did an excellent job looking at our existing codebase, comparing it to the macOS codebase, writing blueprint files, etc. I reviewed everything written, modified some basics, and verified it manually and under Valgrind.

Demo

CleanShot 2025-11-29 at 20 52 11@2x

Future Improvements

  • When dragging the overlay, we should change the cursor and show drop targets
  • There's probably some small stylistic tweaks we can make to this
  • I'm not sure the CSS is right for both light and dark modes so we may need to tweak that

@mitchellh mitchellh requested a review from a team as a code owner November 30, 2025 04:54
fn closureMatchLabel(_: *Self, selected: i64, total: i64) callconv(.c) ?[*:0]const u8 {
if (total <= 0) return glib.ext.dupeZ(u8, "0/0");
var buf: [32]u8 = undefined;
const label = std.fmt.bufPrintZ(&buf, "{}/{}", .{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should ideally be localizable, but we can do that in a different PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this was a safe one to avoid localization, but wouldn't surprise me to learn that x/y is not global lol.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah in some languages (e.g. Chinese) the order of x and y is reversed :) But again we can do this in another PR

@mitchellh mitchellh added this to the 1.3.0 milestone Nov 30, 2025
@mitchellh
Copy link
Contributor Author

Going to send this so we have something in main. Happy to continue to address reviews with future PRs.

@mitchellh mitchellh merged commit 34fd1dd into main Nov 30, 2025
22 checks passed
@mitchellh mitchellh deleted the gtk-search branch November 30, 2025 15:24
@mitchellh mitchellh mentioned this pull request Nov 30, 2025
8 tasks
@xlab
Copy link

xlab commented Dec 2, 2025

Congrats on landing the feature we couldn't get from kovidgoyal/kitty#893 for 7 years!

🎉

@unphased
Copy link

Just a quick question, this is a feature I didn't realize was important but is very much so, and I'm glad to see it landing. however, it's not in a release yet right? It will land in 1.2.4 or 1.3.0?

@mitchellh
Copy link
Contributor Author

Correct. 1.3 slated for march. Complex features need time to bake

@iRubbish
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GTK: Search scrollback

6 participants