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

Move Expression Names to Column Settings Header #2437

Closed
wants to merge 5 commits into from

Conversation

ada-x64
Copy link
Contributor

@ada-x64 ada-x64 commented Nov 16, 2023

Based on #2436 and #2421

This PR moves expression names to the column settings header.
To save the expression, press enter or tab.
Currently when you save the expression name the panel closes. I was originally planning on having the column auto-save, but keeping the panel open requires some significant changes.

@ada-x64 ada-x64 marked this pull request as draft November 17, 2023 17:58
@ada-x64 ada-x64 force-pushed the features/column-name-in-header branch 2 times, most recently from dbb9e85 to 33cf92b Compare November 28, 2023 15:43
@ada-x64 ada-x64 marked this pull request as ready for review November 28, 2023 15:43
@ada-x64 ada-x64 force-pushed the features/column-name-in-header branch from 33cf92b to cfa46f8 Compare November 28, 2023 15:53
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

This has some bugs and feature regressions that need to be fixed up:

  • We've lost the default naming feature - this was also lost in Expressions API Updates #2399 and re-added in Fix expression alias UX/API #2431. Please add a test for this case as well - we really should have caught this and I'm quite surprised the regression made it this far as it involved deleting alot of code, twice. Was this a rebase gone wrong?
  • The title clear button has disappeared - regression of the <input type="search">.
  • In these invalid cases - the save button still works and lets you save columns with broken names.

Before - title reflects the default when empty and has a clear button:

Screen.Recording.2023-11-29.at.12.46.03.AM.mov

Now - title shows an error state that was added, but this is incompatible with the default naming functionality which was removed (?), and the clear button is gone:

Screen.Recording.2023-11-29.at.12.46.58.AM.mov

ada-x64 and others added 5 commits November 30, 2023 14:07
split sidebar into components
error on empty; don't autosave on blur
tests
Remove column selector close button when column settings is open.
Ignore failing promise in code editor.

update snapshots
empty header styling

empty expression names

add test
@ada-x64 ada-x64 force-pushed the features/column-name-in-header branch from cfa46f8 to 02ec5b1 Compare November 30, 2023 20:08
@ada-x64
Copy link
Contributor Author

ada-x64 commented Nov 30, 2023

I've updated this PR to address the feedback.
There are still a few UX questions I think need to be addressed.

  1. When the title is changed, should the save button for the expression editor be enabled?
  2. Should saving the expression also save the title?
  3. Should saving the title (pressing enter on the header) also save the expression?

I'm inclined to say that an unsaved title should be updated when the expression is saved because we are currently closing the column settings sidebar on change. However, with #2459 we'll be keeping the sidebar open. In that case, I'm inclined to say that saving the title and the expression content should be separate operations.

@ada-x64 ada-x64 requested a review from texodus November 30, 2023 20:13
@ada-x64 ada-x64 mentioned this pull request Dec 1, 2023
@texodus
Copy link
Member

texodus commented Dec 12, 2023

This is really well done!

However, it honestly it took me a few minutes to understand what was going on :)

My confusion came from muscle-memory, I tried editing an expression column, then changing the title, but not pressing "enter", instead using the mouse to move focus to the expression editor. In this case, the "title" control shows the dashed-border "edited" state, but the expression editor save button is disabled. From this state it wasn't obvious to me that I needed to re-focus the "title" input and press "enter" to submit the changed title!

@ada-x64
Copy link
Contributor Author

ada-x64 commented Dec 12, 2023

This is really well done!

However, it honestly it took me a few minutes to understand what was going on :)

My confusion came from muscle-memory, I tried editing an expression column, then changing the title, but not pressing "enter", instead using the mouse to move focus to the expression editor. In this case, the "title" control shows the dashed-border "edited" state, but the expression editor save button is disabled. From this state it wasn't obvious to me that I needed to re-focus the "title" input and press "enter" to submit the changed title!

I agree, the UX on this is pretty confusing. I originally wanted to do an auto-save feature, where the column title would update on blur. That lead to an awful experience where the sidebar would close all the time. That was the impetus for #2459. I'd be happy to talk more about the UX with this feature; fwiw auto-save felt very nice, and it was cool to see the name automatically update in three places (in the datagrid, the title itself, and the settings panel).

Alternative approaches could be things like a clearer "unsaved" state, perhaps an icon with a hover that tells the user to press enter (though this is "polite instructions", i.e. bad UX). We could also hook the title into the expression editor save button, though I think this gets confusing when, for example, you want to change the title of an expression column but you have the style tab pulled up. (We could make it uneditable unless you have the attributes tab open, but that's another hidden functionality...)

@ada-x64
Copy link
Contributor Author

ada-x64 commented Dec 18, 2023

Closing in favor of #2459

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