Skip to content

add Import/Export for Nicknames #6160

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

T0biii
Copy link
Contributor

@T0biii T0biii commented Apr 19, 2025

Hey we wanted to exchange nicknames among friends, so we came up with the idea of ​​adding import and export buttons to the Nicknames view.
This is my first time with C++ code, so feedback is very welcome.

Tested on Ubuntu:
image
image
image
image

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

T0biii and others added 3 commits April 19, 2025 02:52
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

I don't mind this feature, but if the goal is to share nicknames between friends I'd prefer if this used something like your system clipboard instead.

So the export button would export the nickname json to your clipboard, and the import button would read that json blob from your clipboard

The label of the buttons should probably be updated to reflect that change as well. "Import from clipboard" and "Export to clipboard" if it fits.
If it doesn't fit where they are now, you can move it to below the nicknames instead.

@T0biii
Copy link
Contributor Author

T0biii commented Apr 21, 2025

I think it's easier to share a file depending on how many nicknames are present, e.g. Discord has a character limit of 2000. 4000 for Nitro Users.
But if you think clipboard would be better i can try to update the pr to clipboard

as example:
the 4 Nicknames in the example above already 445 charcaters
image

@pajlada
Copy link
Member

pajlada commented Apr 21, 2025

I did not consider character limits, let me give it a think

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@pajlada
Copy link
Member

pajlada commented Jun 29, 2025

Sorry for the delay!

I think files are fine, however I think I'd like to be a bit forward-thinking with the import & export format.
Currently you're exporting the nicknames as-is. I'd prefer if we provide some metadata alongside the export that can be used in the import.

I think something like this would be good:

{
    "type": "nickname_export",
    "version": "1",
    "comment": "Exported from Version::instance().buildString() at CURRENT TIME",
    "data": [
        // the nicknames in the same format you were already using
    ]
}

I'm not convinced of the place for the "exportNicknames" and "importNicknames" functions, so I might want to move those around a bit but that's easy to do as a last step.

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