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

[sheets-] record key-col toggle for replay as key-col-on/-off #2622

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

midichef
Copy link
Contributor

@midichef midichef commented Dec 3, 2024

I'm following up on @saulpw's comment about trouble caused by keycol toggling in cmdlog replay.

it's tricky to change behavior based on existing column state, as this can make cmdlog replay a lot less predictable. We already have this with e.g. key-col and it's caused some problems. Maybe the ultimate answer is to have key-col put a more precise command like key-col-on or key-col-off (please help come up with better longnames if we do this) on the cmdlog.

Does the problem with key-col for cmdlog-replay still exist? If so, this PR should fix it, by recording key-col-on or key-col-off instead of key-col.

I'm preparing to submit the feature proposed in that Discussion: changing a column's sort direction while preserving other column's sort direction. So if this kind of fix is still needed for key-col, then I'll apply the same idea to sort-asc and the commands like it.

Copy link
Owner

@saulpw saulpw left a comment

Choose a reason for hiding this comment

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

It hadn't quite occurred to me to do it this way, but you know what, I'll take it. Nice job.

@midichef
Copy link
Contributor Author

midichef commented Dec 3, 2024

Hmm, this PR still needs work. I hadn't thought about the case of macros.

With this change, when key-col is used in a macro, the macro will contain two commands, the original key-col and key-col-on (or -off). So that needs a fix.

But there's also a UI difference between macros and replay logs that makes this approach difficult. Users may expect ! in a macro to perform toggling. Whereas in a cmdlog replay file that's only replayed once, what is desired is setting the keycol state, not toggling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants