-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Introduce border interface #316
base: master
Are you sure you want to change the base?
Conversation
@nervo This is SO RAD. We're definitely open to it. Could you share what a |
@meowgorithm i'm glad to have your attention :) So, well, combining at the same time the both constraints of lighten the interface, and give a way to customize border of any direction (top, right, bottom, left), i was thinking about a notion of A borderer object could have 4 main methods to get 4 regions of 4 directions:
Each of this regions (also interfaces) should then be able to respond to the current methods of:
Ultimately, a region should have a This way, something like that could be possible: style := lipgloss.NewStyle().
Borderer(
NewBorderer(
NewTitleRegion("This is my amazing and far too long title"), // Top: a title
NewScrollbarRegion(...), // Right: a scrollbar (linked to a viewport, for instance)
NewRegion(), // Bottom: Nothing special, a traditionnal border
NewRegion(), // Left: Nothing special, a traditionnal border too
)
) What do you think ? |
Okay this is cool. To properly understand it a full, runnable example would be really helpful. Does charmbracelet/bubbles#536 use this API? |
Hey @nervo if you have a working example of this, it would be great to test out! |
Hey @nervo pinging again to see if you have a working example of this feature |
While i was working on my pr on a scrollbar bubble component (see: charmbracelet/bubbles#536), i suddenly realized how amazing it would be if such a component could be render as a border.
imagine something like that:
Anyway, i quickly realized too that the way border are handled, there is no room for custom complex rendering...
So i came up with an elegant solution, in multiple steps. The first one would be to introduce a new interface
Borderer
, and a first non-breaking implementation:NormalRenderer
. Then, it's all about transferring border responsabitilities to borderer.Here is this first step :)
Before going further, and make this interface able to handle complex borders, i would like to know if you're interested in :)
One of the annoying point to fix first, would be - for instance - the incredible heavy interface weight:
Somehow related: