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

Add drop-down menu to load a previous config #586

Merged
merged 5 commits into from
Jun 28, 2023

Conversation

JosephMarinier
Copy link
Contributor

Description:

I show a hash of each config in a colored chip to easily tell if some configs are duplicates (for example when going back and forth between two configs). The color of the chip is based on the hash. Special cases:

  • Don't show the hash (hashSize = null) if no two different configs have the same name. ❓ Maybe that's not desirable?
  • Show a 6-char hash if there is a collision in the first 3 chars.❓ Do you think that is overkill? See the probabilities below.
  • Otherwise, show a 3-char hash.

I calculated the probability of a hash collision (two different configs producing the same hash)...

  • with the 3-char hash:
    • 10 different configs: 1 %
    • 30 different configs: 10 %
    • 76 different configs: 50 %
  • with the 6-char hash:
    • 581 different configs: 1 %

image

Checklist:

You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.

  • ISSUE NUMBER. You linked the issue number (Ex: Resolve #XXX).
  • PRE-COMMIT. You ran pre-commit on all commits, or else, you
    ran pre-commit run --all-files at the end.
  • USER CHANGES. The changes are added to CHANGELOG.md and the documentation, if they impact
    our users.
  • DEV CHANGES.
    • Update the documentation if this PR changes how to develop/launch on the app.
    • Update the README files and our wiki for any big design decisions, if relevant.
    • Add unit tests, docstrings, typing and comments for complex sections.

* Don't show the hash (hashSize = null) if no two different configs have the same name.
* Show a 6-char hash if there is a collision in the first 3 chars.
* Otherwise, show a 3-char hash.
same visual, better semantics
@gabegma
Copy link
Contributor

gabegma commented Jun 27, 2023

WHAT!! How cool is that!!!!

Copy link
Collaborator

@christyler3030 christyler3030 left a comment

Choose a reason for hiding this comment

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

Neat! Approved. Question: is it worth keeping multiple copies of configs that have the same hash? I can see why you would do it but just posing the question.

@JosephMarinier JosephMarinier merged commit 05256e2 into main Jun 28, 2023
2 checks passed
@JosephMarinier JosephMarinier deleted the joseph/load-previous-config branch June 28, 2023 15:12
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.

None yet

3 participants