-
Notifications
You must be signed in to change notification settings - Fork 73
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
Topic Banner #237
Topic Banner #237
Conversation
Currently the topic bar searches the channel history (new to old) to find the topic, then puts it in a scrollable at the top of the channel pane. If no topic is found, then no scrollable is created. Included in the topic bar is the user that set it and when it was set, with the user's nick being able to be clicked on if they are in the channel. I made it background-color text on an info color scrollable to keep it distinct from the other views, but picked the darkest shade of the info color to try to reduce how distracting it can be. A maximum height can be set in the config to limit the height of the topic banner, with the default aiming to be two lines tall. |
It's hard to review it since it builds on top of another PR. I would, if not too complicated, like to have it separate so we can work on them separately. Idea is great though, so I would like to see if we can land this feature. |
Absolutely, sorry about that. Wasn't sure how GitHub would handle the PR, but I can see now it's a bit of a mess. Will disentangle then force push. |
7bd2345
to
33fc813
Compare
Disentangled :) |
f46b1c5
to
397fd70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7268629
to
8dfa9fa
Compare
@tarkah mind taking a look at this as well? |
Let me look tomorrow, sorry for my delay on this |
a655b0d
to
1ad5424
Compare
I am trying a few different designs tests, will report back tomorrow with some suggestions. Good job on this @andymandias. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've played around with styling a bunch, and I think, for now, what I like the most is actually to keep it as simple as possible, just like the nick_list
which uses: theme::Scrollable::Hidden
as well as theme::Text::Transparent
to blend it more with the pane header. That way we can also remove theme::Scrollable::Banner
and theme::Text::Banner
. When playing around with this, I found that changing the padding slightly at src\buffer\channel.rs:160
worked the best:
container(body)
.width(Length::Fill)
.height(Length::Fill)
- .padding(8)
+ .padding([4, 8, 8, 8])
.into()
Regarding layout i think we should go for a layout like this:
| topic | users |
|---------| |
| message | |
Because it can look a little strange if topic isn't long enough and user list starts below:
Third, and last thing, I think we should add a pane button. Notice the button on the top image. Ive tried a bunch and kinda like the following:
pub fn topic<'a>() -> Text<'a> {
to_text('\u{f5af}')
}
I think, with a button like this we can simplify the config a little as well and make it similar to Users:
buffer:
users:
visible: true
Perhaps we could simply do:
buffer:
topic:
visible: false
max_lines: 2
Functionality should just be 1 to 1 with showing and hiding nick_list
.
Let me know what you think about these suggetions, @andymandias.
Thank you for the notes @casperstorm. I think these are all good changes, and mesh into the Halloy style better. Re: padding. By removing the background color from the topic banner we can shrink the padding on it without any aesthetic changes. Over here there's been a downside to the topic banner's current padding where it would show a sliver of the third line when only two lines were otherwise showing. For example with the currently-committed padding I see: So, unless there's an issue I'm going to remove the vertical padding from the topic banner. I believe that will be equivalent to the padding change you've suggested in I am slightly concerned that there's not a lot differentiating the topic from the rest of the channel text. Would using something like a light horizontal rule fit within the Halloy style? A seasoned user probably wouldn't need it, but a newbie might be able to use the extra affordance. I like the pane button idea quite a bit. I'm assuming toggling the topic button should show/hide the inline topic messages accordingly. Is that right? Or would it only toggle the visibility of the banner? I think matching configuration options is ideal, but I am concerned it could be confusing to users if they set |
|
Thank you for the clarifications! I'll make the changes, going with both banner and server messages configuration options as you describe. No sweat if we wind up changing the configuration options again :) |
Some chores left to be done (e.g. example config update, code clean-up pass, etc), but I believe this has the new configuration and functionality we're looking for. I struggled a little with the under-topic padding since its apparent height can be influenced by scroll state of the messages in the channel; if I didn't get it right please feel free to fix (or let me know how far off I am). |
…o be colored. Restructure configuration.
…dling an empty container is needed.
Since the first if branch is on message source as well
…er configuration). Add topic toggle button to pane (functionality mimicking the existing users toggle button). Tweak padding under topic banner / above message history.
c8e3c7f
to
57727c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated padding slightly, example config file, CHANGELOG and then rebased on main. We should update wiki once we merge.
I don't have anything else - this looks awesome, and what awesome feature. Do you have anything you want to clean up before we merge @andymandias?
Did a quick review and didn't see anything I made too messy. Looks good to merge to me. Thanks for taking care of the rest of the chores @casperstorm, and for all the guidance from you and @tarkah. |
Initial implementation for #236. Currently it builds on #221, but it can be disentangled if that complicates the process.