Skip to content

Conversation

@cruessler
Copy link
Collaborator

@cruessler cruessler commented Jan 24, 2026

This PR is an attempt at unblocking #2827. It removes the dependency on tui-textarea and implements a component that is mostly API-compatible with TextArea. The new component currently has a reduced API surface, in order to make this initial PR smaller. I hope that I’ve already implemented most of the methods we want to keep using.

@extrawurst Some of the methods are still marked as todo!(). Would you mind having a quick look to let me know which ones we want to have implemented before this can be merged?

TODO

  • Make scrolling work
  • Implement set_mask_char
  • Remove remaining functions that are not implemented yet

Copy link
Collaborator

@extrawurst extrawurst left a comment

Choose a reason for hiding this comment

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

Awesome work! I think for an MVP we can leave out all todos besides the one for the mask input (needed for password inputs)

}

fn set_mask_char(&mut self, _char: char) {
todo!();
Copy link
Collaborator

Choose a reason for hiding this comment

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

we will likely need that to support password inputs

This is to have a single source of truth for `self.scroll.top`.
Currently, it depends entirely on `self.cursor.0` and keeping it that
way obviates the need to change `self.cursor.0` after calling
`self.scroll.move_top`. Instead, we don't call `self.scroll.move_top`,
but simply change `self.cursor.0`. This change then propagates to
`self.scroll.top` through `self.scroll.update` in `draw`.
@cruessler
Copy link
Collaborator Author

Perfect! I’ve now addressed all the remaining TODO items. I’ve tested the component as it is used inside the commit message popup. Apart from that, I relied on the tests that I added. I’m reasonably sure that things are working as expected, but it certainly wouldn’t hurt if someone else also tested the changes. :-)

@cruessler cruessler marked this pull request as ready for review January 25, 2026 11:10
@cruessler cruessler requested a review from extrawurst January 25, 2026 11:10
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.

2 participants