Skip to content

Support configuring user gutter width#223

Merged
ulyssa merged 4 commits intoulyssa:mainfrom
mordquist:configurable-user-gutter
Mar 24, 2024
Merged

Support configuring user gutter width#223
ulyssa merged 4 commits intoulyssa:mainfrom
mordquist:configurable-user-gutter

Conversation

@mordquist
Copy link
Copy Markdown
Contributor

I found the user gutter too wide by default, especially when using localpart or display name for usernames so i made it configurable. Seems to work fine but I'm not a rustacean so there is perhaps a more idiomatic way to do this.

Copy link
Copy Markdown
Owner

@ulyssa ulyssa left a comment

Choose a reason for hiding this comment

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

This looks good! I first chose 30 as the width before adding support for display names, so it's definitely a little wide with the other configurations.

There are a couple clippy warnings. I've commented on them and ways that I think you can improve on what it's recommending.

Comment thread src/config.rs Outdated
open_command: self.open_command,
notifications: self.notifications.unwrap_or_default(),
image_preview: self.image_preview.map(ImagePreview::values),
user_gutter_width: self.user_gutter_width.unwrap_or(30 as usize),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

cargo clippy suggests 30_usize here, but I'm pretty sure you should just be able to do 30 and inference will figure it out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Had problems with 30 getting inferred as u16 but I don't have that problem anymore. Maybe the LSP that was not working properly. Works as you suggested for me now.

Comment thread src/message/mod.rs Outdated
@mordquist mordquist force-pushed the configurable-user-gutter branch from 309e7c5 to a0d141a Compare March 24, 2024 00:44
@mordquist
Copy link
Copy Markdown
Contributor Author

Thank you for the quick review and suggestions. Hopefully everything looks good now.

@ulyssa ulyssa added this to the v0.0.9 milestone Mar 24, 2024
@ulyssa ulyssa changed the title Configurable user gutter width Support configuring user gutter width Mar 24, 2024
@ulyssa ulyssa merged commit 46e081b into ulyssa:main Mar 24, 2024
@mordquist mordquist deleted the configurable-user-gutter branch March 24, 2024 12:32
@ulyssa ulyssa mentioned this pull request Mar 29, 2024
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