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

Experiments around config wizard #312

Closed

Conversation

TornaxO7
Copy link
Contributor

This PR should give himalaya a config wizard like mutt-wizard.

@TornaxO7 TornaxO7 marked this pull request as draft February 27, 2022 02:40
@TornaxO7 TornaxO7 changed the title adding first commit for config-wizard Config wizard Feb 27, 2022
Cargo.toml Outdated Show resolved Hide resolved
src/config/mod.rs Show resolved Hide resolved
@soywod soywod linked an issue Feb 27, 2022 that may be closed by this pull request
@soywod soywod added cli Related to the CLI enhancement New feature or request labels Feb 27, 2022
@TornaxO7
Copy link
Contributor Author

So I've a question here @soywod : Do you agree, if I use dialoguer? Here are my reasons:

  1. reqeuestty seems to be pretty young and I don't know really know how "far" it is.
  2. enquirer seems to be commandline-binary-tool which should be used for bash scripts for example not as a library for rust-project. It's using dialoguer underneath.
  3. promptly doesn't look as mature as dialoguer.

What do you think? Please note that I just quickly went through their readme and a little bit through their docs so it might happen, that I skipped some important parts.

@soywod
Copy link
Owner

soywod commented Feb 27, 2022

dialoguer looks really good and seems to fit well our needs, let's go for it 🙂

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Feb 28, 2022

@soywod little question here (I think that I've asked that already once, but I can't find my question anymore):
You wrote the following in your code:

/// Represents the user account.
#[derive(Debug, Default, Clone)]
pub struct AccountConfig {
    /// Represents the name of the user account.
    pub name: String,
    /// Makes this account the default one.
    pub default: bool,
    /// Represents the display name of the user account.
    pub display_name: String,
    ...
}

What's the difference, between name and display_name? Is it meant to be like this:

[name]
name = display_name

?

@soywod
Copy link
Owner

soywod commented Feb 28, 2022

The name is the name of the account (the one you put between brackets at the top of every account in the TOML config). See it as the key or the identifier. The display_name is the full name of the user that owns the account.

@TornaxO7
Copy link
Contributor Author

Hi! I've got another questiong: As you mentioned, it'd be pretty nice if we could get the host-data just by looking up the hostname of the e-mail-address. So I'm wondering if we should store the same .csv file with the host-information in mutt-wizard in himalaya or just download it everytime the user starts the wizard and remove it afterwards. What do you think about this?

@soywod
Copy link
Owner

soywod commented Feb 28, 2022

Mmmh good point. I don't know if downloading it every time is the good option (although, it looks appealing). Maybe we could download it inside himalaya and update it time to time manually (at least for a first version)? What do you think?

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Feb 28, 2022

Hm... I could imagine, that 17.5KB is quite a lot for some people so I think that downloading it into himalaya is fine.
But now I'm a little bit unsure how we should add those entries into the binary? Most people are probably just downloading the compiled version of himalaya from their package-manager.

I think an optional question to the user, if the wizard should try to figure the host out on its own, can be added, so if the user thinks that downloading a csv file takes to long (just to get the host-information), then he/she can say simply "no".

@soywod
Copy link
Owner

soywod commented Feb 28, 2022

I think an optional question to the user, if the wizard should try to figure the host out on its own, can be added, so if the user thinks that downloading a csv file takes to long (just to get the host-information), then he/she can say simply "no".

Yeah, sounds good. Maybe sth like "configuration type: manual | auto".

@soywod soywod deleted the branch soywod:development March 1, 2022 22:18
@soywod soywod closed this Mar 1, 2022
@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Mar 1, 2022

huh, why did you delete the development branch?

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Mar 1, 2022

oh I see, you released a new version

@soywod
Copy link
Owner

soywod commented Mar 1, 2022

huh, why did you delete the development branch?

The auto-delete branch feature deleted it after having merged development into master for the release… sorry. I just removed this option!

@soywod soywod reopened this Mar 1, 2022
@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Mar 1, 2022

No problem

@soywod
Copy link
Owner

soywod commented Mar 14, 2022

How is it going with this feature? I'm asking because some breaking changes are coming (see https://github.com/soywod/himalaya/discussions/345) and I'm afraid we will reach the same conflicting problems than with the TUI. After the v0.6.0 we should reach sth quite solid, and it could be the right moment to start big works like the TUI, the GUI and this config wizard.


I'm sorry for all those breaking changes. I'm aware that I may also have broken your motivation after the TUI and now the config wizard. Himalaya comes from far (it's been years I'm experimenting sth around), and it was hard to find the place and the direction of this tool. It is only since the v0.5 and the backend features that I really start to gain confidence and visibility. From now the tool should be more and more solid and should introduce less and less breaking changes. The v1 should not be so far from the v0.6!

@TornaxO7
Copy link
Contributor Author

How is it going with this feature?

Welp, I can't find any time for this feature at the moment. As I already said I'm in my exam-session at this moment.

and I'm afraid we will reach the same conflicting problems than with the TUI.

Don't worry, there are only about 100 LOC which I changed, so it's not a big lost.

I'm sorry for all those breaking changes. I'm aware that I may also have broken your motivation after the TUI and now the config wizard. Himalaya comes from far (it's been years I'm experimenting sth around), and it was hard to find the place and the direction of this tool.

No need to apologize :) I can't complain if it improves himalaya and provides a better API for the TUI.

Anyway, my motivation is not completely gone for the TUI. It just became smaller since I found another project which seems to be more interesting to me. So I think, that I'll still participate at the TUI when the time comes. But for the time being I need to pass my exams first xD

Should I close this PR?

@soywod
Copy link
Owner

soywod commented Mar 14, 2022

Yeah we can close. We will come back on it later, when the time comes.

But for the time being I need to pass my exams first xD

Good luck dude 🤞 💪

@soywod soywod closed this Mar 14, 2022
@soywod soywod changed the title Config wizard POC: config wizard Mar 14, 2022
@soywod soywod changed the title POC: config wizard Experiments around config wizard Mar 14, 2022
@TornaxO7 TornaxO7 deleted the 244_adding_config_wizard branch May 28, 2022 09:56
@kmaasrud kmaasrud mentioned this pull request Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the CLI enhancement New feature or request
Projects
None yet
2 participants