Skip to content
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: unread #62

Merged
merged 5 commits into from
Jun 29, 2023
Merged

Feat: unread #62

merged 5 commits into from
Jun 29, 2023

Conversation

tarkah
Copy link
Member

@tarkah tarkah commented Jun 29, 2023

Resolves #40

Adds the following:

  • Sidebar icons are "filled" when there are "unread" messages. "unread" counts as any received message from a user or action (/me). Server messages don't trigger this. Likewise, the server entries in the sidebar don't show unread notifications. I feel this makes sense since we only care about new user messages.
  • Buffers show a horizontal rule between the last and new messages since the buffer was last opened.
image

Comment on lines +70 to +77
let content = if show_divider {
let divider = container(horizontal_rule(1).style(theme::Rule::Unread))
.width(Length::Fill)
.padding([0, 8]),
)
.vertical_scroll(
scrollable::Properties::default()
.alignment(status.alignment())
.width(5)
.scroller_width(5),
)
.on_scroll(move |viewport| Message::Scrolled {
count,
remaining,
oldest,
status,
viewport,
})
.id(state.scrollable.clone())
.into()
.padding(5);
column![column(old), divider, column(new)]
} else {
column![column(old), column(new)]
};
Copy link
Member

Choose a reason for hiding this comment

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

Clean way of doing this, nice!

Copy link
Member

@casperstorm casperstorm left a comment

Choose a reason for hiding this comment

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

This turned out awesome. I might wanna play with other "unread" indicators, but for now this is great.

@casperstorm
Copy link
Member

I took action and changed our icons to only a dot if theres any unread messages. I feel like it became to busy before.

Screenshot 2023-06-29 at 14 55 38

@tarkah
Copy link
Member Author

tarkah commented Jun 29, 2023

I took action and changed our icons to only a dot if theres any unread messages. I feel like it became to busy before.

Agreed! This is much nicer :D

@tarkah tarkah merged commit 046b24e into main Jun 29, 2023
@tarkah tarkah deleted the feat/unread branch June 29, 2023 15:29
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.

Display unread message count
2 participants