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

Save Command History to Storage #137

Merged
merged 3 commits into from
Sep 30, 2020
Merged

Save Command History to Storage #137

merged 3 commits into from
Sep 30, 2020

Conversation

chriscoyier
Copy link
Collaborator

For this: #13

Not working great now. The biggest problem (and this came up with Thoughts storage too) is that I'm not sure the best way to know the Character name (which I think is a good unique identifier for storage) at certain points in the code. So I resort to asking the DOM for it, which is bad enough as is, but in my first commit here, I even setTimeout for a bit because the DOM doesn't know it yet in time for the CLI constructor.

It does "work" though, except that it doesn't seem to be loading back in a command history on a per-session basis as it should, but instead loading in the same buffer for everyone.

@ondreian
Copy link
Collaborator

Session.current.name is the best way to find the current session.

I'm unsure if these need to be grouped by the name though, I've been thinking a lot about this, and you can basically have a significantly larger pool of autocomplete options if they are not binned by name, and I am not sure how functionally useful the commands being silo'd is.

@chriscoyier
Copy link
Collaborator Author

I'm unsure if these need to be grouped by the name though, I've been thinking a lot about this, and you can basically have a significantly larger pool of autocomplete options if they are not binned by name

I'm fine with that. Especially because it's philosophically aligned with your thing about the CLI not clearing itself when you change between accounts. Like commands can be character-sharable.

I am not sure how functionally useful the commands being silo'd is.

My only thinking with the silo'ing is that they (I think!) are silo'd when you are in a session. So when I'm playing one character, and I can always count on that "up arrow" being something that this character actually did. But then if I refresh the client, all the sudden that "up arrow" has stuff in it from other characters. But the "larger pool" does mean that if I start typing, the chances of a useful autocomplete coming up is higher, which is good, so let's just ship that for now.

@chriscoyier chriscoyier changed the title WIP: Save Command History to Storage Save Command History to Storage Sep 25, 2020
@chriscoyier chriscoyier merged commit 3b94d64 into master Sep 30, 2020
@ondreian ondreian deleted the feat/commands_storage branch November 26, 2020 15:16
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