-
Notifications
You must be signed in to change notification settings - Fork 132
feat(config): collapsed sections #218
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
Conversation
|
Makes sense, I'll test this out soon! |
I didn't quite get your comment here, you duplicated some keys and kept |
|
What the hell did I copy paste x) Yes, just changing the name of it was my idea. Perhaps 'collapsed_sections' is good enough :) |
|
Done. |
|
An issue I've thought of is that there's no real scheme for ids of items in gitu. These were put in just in order to have a (hopefully) unique reference to an item that would remain between reloads of data. (so that collapsed sections will remain collapsed on a reload). Perhaps only these defined sections on the status screen should be configurable? Currently the sections seen on the status screen are also not consistent: #[test]
fn collapsed_sections_config() {
let mut ctx = TestContext::setup_clone();
ctx.config().general.collapsed_sections = vec![
// TODO Are we doing snake_case or not?
"untracked".into(),
"Recent commits".into(),
"branch_status".into(),
// TODO rebase / revert/ merge conlict?
];
fs::write(ctx.dir.child("untracked_file.txt"), "").unwrap();
snapshot!(ctx, "");
}It would be nice if it's documented in the default config too, exactly which ones can configured as collapsed. Does that make sense? |
Yes that's why I thought. I think IDs should be snake case, but for the config part, it shouldn't matter. We can take the user text and make it
Yeah, well, we can never know what users want, and if we go through the route of unique snake_case IDs, then theoretically it would even be less specific code since we don't have to manage exceptions?
I added in the docs the one you included in the tests since they definitely make the most sense ATM. And since we're at collapsed sections, I noticed that when I press |
| # To collapse untracked files by default. e.g.: | ||
| # collapsed_sections = ["untracked", "Recent commits", "branch_status"] |
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.
"You can have sections collapsed by default:", or something like that?
I'd like to see these consistent.
recent_commits? Would need to set this id, should be easy.
|
Seems fine to start with these. |
|
superseded by #276 |
I stringed this in a couple of minutes, so I am not sure whether this is enough.
I tried to look for tests on collapsed sections, and couldn't find something useful.
I'll be happy to add a test if you have a good idea on what to do.