Skip to content

Credentials dropdown in sign in window#4693

Open
Leinnan wants to merge 2 commits into
mainfrom
feature/savedCredentials
Open

Credentials dropdown in sign in window#4693
Leinnan wants to merge 2 commits into
mainfrom
feature/savedCredentials

Conversation

@Leinnan

@Leinnan Leinnan commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Adds dropdown menu with saved credentials to choose from.

image

@github-actions

Copy link
Copy Markdown
Contributor

Lightbeam link

@allister-beamable allister-beamable left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some style/syntax comments, but nothing really demanding changes. Otherwise looks good!

Any concerns about what happens when there is an egregiously large set of saved credentials? I suppose if the main symptom is that the rendered list threatens to overflow the available space, the people adding credentials will notice and perhaps avoid adding more. 😸

I would like to hear from @cdhanna and @DiasAtBeamable on this. Feels like we can take our time with it since it is not harming anything not to have it.

{
var badgeColor = new Color(0,0,0,.3f);
if (_editorAPI?.BeamCli.CurrentRealm?.IsProduction ?? false)
if (!_editorAPI?.BeamCli?.IsLoggedOut ?? true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ugh, I lowkey hate this syntax. I suppose it is necessary because the value of _editorAPI?.BeamCli?.IsLoggedOut ends up being null if any of the question-marked ones is null?

No need to change it, just grumping about C# syntax.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

🫂

}
set
{
var vv = JsonUtility.ToJson(new SavedCredentialsArray{items = value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not thrilled about vv as a variable name; I suppose its only use is right next to it, so it is not actually all that unclear, and value is a keyword. Were it my code, I would likely name it credsValue or something. Verbosity in hopes of clarity.

No real need to change, just a statement of code style preference: I would rather see longer, more descriptive variable names.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

FIxed

try
{
return JsonUtility.FromJson<SavedCredentialsArray>(
EditorPrefs.GetString("Beamable.SavedCredentials", "{}")).items.ToList();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless we have all the tooling for clearing out the editor prefs- I am sad about mixing our data stores.

Is the goal to remember credentials from between all your projects, or just this one Unity project? If it is just the one unity project, I would recommend we keep our own json file in the .beamable folder. My thinking there is; from the users' perspective, there should be one place where persistent stuff is stored.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I forgot that the EditorPrefs is shared between projects. I am not so confident in using .beamable for that though, what do You thinkg about using EditorUserSettings GetConfigValue and SetConfigValue? Then it would be stored in the %PROJECT_ROOT%/UserSettings/EditorUserSettings.asset which is fine for me, since I decided not to store the password there.

}
}

EditorUtility.DisplayCustomMenu(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if possible, I would vote we re-use the existing beam editor dropdown window stuff we use in other parts of the editor; rather than use the right-click visual style. I think we could control the UI a little better to even group accounts by their alias and such.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I went this way because the IMGUI with dropdown had issues with depth sorting, but I am open for other approach, more consistent with the rest of the UI

@github-actions

Copy link
Copy Markdown
Contributor

Lightbeam link

@DiasAtBeamable DiasAtBeamable left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, I've just added a suggestion.

{
try
{
var savedValue = EditorUserSettings.GetConfigValue("Beamable.SavedCredentials");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be nice to have "Beamable.SavedCredentials" as a const string variable.

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.

4 participants