mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-26 19:05:52 +03:00
[GH-ISSUE #292] Allow SplitFixed to set the size of the second container #147
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pavel-lexyr on GitHub (Feb 5, 2021).
Original GitHub issue: https://github.com/mum4k/termdash/issues/292
Originally assigned to: @spacez320 on GitHub.
Issue
As per the documentation,
This allows for simple adaptive design if one wants to fix widgets on the left side or on top of the screen. Fixing a widget on the bottom is comparatively complex, (or entirely simple, but not documented).
It would be a helpful change to allow fixing the second container in splits.
Proposed API change:
container.SplitFixedis to allow numbers from1-cellsto-1as its argument. Providing it with a number like this fixes the second container to the absolute value of the argument. Values of0andcellsare preserved as is to maintain backwards compatibility.@mum4k commented on GitHub (Feb 6, 2021):
Hi @Ludar-Pavel, I think you raise a very good point here.
Can you help me understand which of the following you are proposing?
a) Allow the split functions to take one or the other size as a fixed number, but continue adjusting the other size dynamically according to the available space. I.e. the user can either set the left/top side to a fixed size and the size right/bottom part gets the remaining space as its size, or vice versa.
or
b) Allow the split functions to take both sizes as a fixed number, allowing the user to set both the left/top and right/bottom parts ti a fixed size.
I think (a) is something very workable in the current architecture and we just need to discuss how to change the API. (b) would be harder due to assumptions made by the infrastructure. We can discuss these and try to find solutions if (b) is the goal.
@pavel-lexyr commented on GitHub (Feb 10, 2021):
(a) is definitely the goal here - it's hard to imagine how (b) would work with the current way layout is set up.
@mum4k commented on GitHub (Feb 12, 2021):
Thank you for confirming that @Ludar-Pavel, (a) is definitely workable and we just need to agree on how we make the API change.
Before we do that, can you please indicate if this is something you would be interested in implementing, or if you would prefer I do the implementation?
@pavel-lexyr commented on GitHub (Feb 12, 2021):
I imagine you doing it would incur less overhead - not very versed in Go myself. Do wish you all the best in implementation, though!
@mum4k commented on GitHub (Feb 15, 2021):
Thank you @Ludar-Pavel, I will update here once it gets implemented.
@spacez320 commented on GitHub (Feb 26, 2024):
Hey @mum4k , any updates on a potential implementation? Would you still be interested in changing the API to allow for this, or interested in possible contributions for it?
@mum4k commented on GitHub (Feb 27, 2024):
Thank you for expressing interest in this @spacez320. As far as I know, this isn't currently worked on, you are more than welcome to pick it up if interested.
From the API perspective, I would recommend we implement a new option instead of giving negative numbers special meaning when
SplitFixedis called. Here is one suggestion, but I am open to other ideas.SplitFixedoption as it is today for backwards compatibility.SplitOption, something likeSplitFixedFromEndthat allows to specify the size of the split from right/bottom.Please feel free to suggest a cleaner way.
@spacez320 commented on GitHub (Feb 27, 2024):
@mum4k I like
SplitFixedFromEnd, great suggestion. We'll go with that.Let me know if there is a timeline I should work against, otherwise I should be able to approach this soon.
@mum4k commented on GitHub (Feb 27, 2024):
Thank you for offering to help, I will assign this issue to you.
No particular timeline, please work at your convenience. I am happy to tag a new release whenever this will be available.
@spacez320 commented on GitHub (Mar 5, 2024):
@mum4k I'm planning on still adding the
SplitFixedFromEndfunction and leaving the existing public API alone, but I am proposing an API change underprivate/.See: https://github.com/mum4k/termdash/pull/373
Let me know if that's not ok and we should leave the entire interface alone.
@spacez320 commented on GitHub (Mar 8, 2024):
@mum4k #373 is ready to be looked at.
For anyone who might be following, the above change preserves the entire API and only augments.