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

Improve UX when creating new items #4089

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open

Improve UX when creating new items #4089

wants to merge 12 commits into from

Conversation

seancolsen
Copy link
Contributor

@seancolsen seancolsen commented Dec 17, 2024

What this PR does

Prompts users to name tables during creation

Fixes #2490

Makes behavior consistent after creating most things

Fixes #4055

The pattern is now to remain on the view of all the things — not to "open" the new thing you just created.

The one exception is Users because the workflow and UX would require more changes there.

Adds a new low-level highlightNewItems svelte action

  • This is the real meat of the PR!

  • See the demo video below to understand how it works.

  • There were lots of tricky challenges in building this, and I'm pretty happy with how it turned out. I ended up using IntersectionObserver, ResizeObserver, MutationObserver, requestAnimationFrame, and @starting-style. Phew!

  • I'll note that @starting-style is still not widely supported, but I think that's okay here. Users with older browsers won't see the highlight or the hint, but these are not crucial features. They can still use Mathesar without them. And at this point all major browsers have recent versions with sufficient support, so it's only a matter of time before necessary support is wide.

Highlights newly-added things

Fixes #4054

  • This PR highlights newly-added:

    • Databases
    • Schemas
    • Tables
    • Child roles
    • Privileges
  • It does not highlight newly-added:

    • ❌ Users

      We have a page-based workflow for adding and editing users. We'd need larger changes in order to bring this workflow into consistency with the rest of the app, and I didn't want to take that, both for the sake of implementation scope, and for the sake of minimizing design changes/discussions.

    • ❌ Roles, Collaborators

      I want to get Comprehensive documentation improvements #4031 merged before messing with that UI again.

      Also Implementation will require some additional complexity within new-item-highlighter in order to handle a row that contains multiple top-level elements being added together.

    • ❌ Rows, Columns — because implementation would be tricky

    • ❌ Filter, Sort, Group, Record summary template fields, exploration transformations

      I don't think highlighting is necessary here because the newly-added items appear right next to the button to add the thing, so it's pretty clear to the user which one was just added.

    • ❌ Links, Constraints

      I skipped these for the sake of time because they seem lower-priority

Demo

2024-12-19_11-16-45.mp4

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@seancolsen seancolsen added this to the v0.2.0 (beta release) milestone Dec 17, 2024
@zackkrida zackkrida added the pr-status: revision A PR awaiting follow-up work from its author after review label Dec 17, 2024
@seancolsen seancolsen marked this pull request as ready for review December 19, 2024 16:26
@seancolsen seancolsen assigned pavish and unassigned seancolsen Dec 19, 2024
@seancolsen seancolsen added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Dec 19, 2024
@seancolsen
Copy link
Contributor Author

@ghislaineguerin you might be interested in looking over the UX here as well.

@pavish pavish requested review from pavish and removed request for rajatvijay December 24, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: review A PR awaiting review
Projects
None yet
3 participants