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

Hide columns in the UI #4062

Open
zackkrida opened this issue Dec 7, 2024 · 1 comment
Open

Hide columns in the UI #4062

zackkrida opened this issue Dec 7, 2024 · 1 comment
Labels
needs: product approval It's not yet clear that this issue will actually improve Mathesar from a user's perspective needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution restricted: maintainers Only maintainers can resolve this issue type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Milestone

Comments

@zackkrida
Copy link
Contributor

Problem

It is useful to hide columns from view for a variety of use cases:

  • Data input and editing:
    • Speed up data input or editing so the user doesn't have to scroll pass columns not being altered
    • Acts as a rudimentary "soft protect" on fields the user doesn't want edited
  • Reading data:
    • Hide irrelevant fields from view to speed up scanning

Proposed solution

Introduce an additional button in the quick actions toolbar next to "filter", "sort", and "group" called "hide", which, when clicked, shows a list of the columns and a toggle icon next to each column to alter their visibility.

Additional context

  • This is purely presentational and doesn't alter the data.
  • Difficulty arises when considering Mathesar's approach to adding new rows and the case in which hidden columns are non nullable without default values1. We may have to reveal all columns when editing rows or find a way of informing the user, for example "{x} Hidden cells cannot be null. Please make them visible and provide values before saving your new record."

Footnotes

  1. Supporting not null columns without default values is actually a really compelling feature of Mathasar's tight coupling to Postgres that I am unable to observe in other spreadsheet-like tools! They all seemingly allow for empty values on columns.

@zackkrida zackkrida added type: enhancement New feature or request needs: triage This issue has not yet been reviewed by a maintainer labels Dec 7, 2024
@seancolsen seancolsen added work: frontend Related to frontend code in the mathesar_ui directory restricted: maintainers Only maintainers can resolve this issue needs: product approval It's not yet clear that this issue will actually improve Mathesar from a user's perspective needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution and removed needs: triage This issue has not yet been reviewed by a maintainer labels Dec 9, 2024
@seancolsen
Copy link
Contributor

I 100% agree that it would be great to have a way to hide columns.

Your proposed solution would be relatively easy to implement, but I'm not sure it would go very far towards the sort of "hide columns" feature that I think most users would expect and want. Incidentally, this happens to be the perfect sort of feature to demonstrate why I'm so keen on this worksheets idea I've been beating a drum about, so I'll take the opportunity to explain more...

Here's what I don't like about your proposed solution: when I hide a column, the column would only stay hidden ephemerally. There would be no way to save that choice more permanently. The filter/sort/group settings are serialized into the URL. So technically speaking I could bookmark that link and come back to it later. But that's not very usable. In a spreadsheet, when I hide a column, it stays hidden. I think the ubiquity of spreadsheets will inform much of our users expectations, which is why I think users will expect a "hide column" feature that offers more persistence.

The worksheets design solves this persistence problem by providing a container to hold all these kinds of settings. Want to hide a column? That choice would be persisted within the worksheet. Want to resize a column? Its size would be persisted in the worksheet too.

My worksheets vision would have all interactions with tables happen through worksheets, so let's consider the user flow for hiding a column...

  1. Open a table. In doing so, you'd open the "default worksheet" for that table.

  2. Hide a column. At this point the worksheet would be modified, triggering some UI to notify the users of unsaved changes to the worksheet.

  3. With unsaved worksheet changes, you'd still be able to do plenty of stuff, i.e. paginate, modify data, etc. And all unsaved worksheet changes would be serialized into the URL, just like the filter/sort/group settings are right now.

  4. With unsaved worksheets changes, you'd (obviously) have the option to save the worksheet.

    • If you started the worksheet from scratch or opened a custom worksheet (not a default worksheet for a table), then you'd have the option to save over the original.

    • If you opened the worksheet via the default worksheet for a table, then only certain worksheet states would be possible to re-save as a default worksheet. Hiding a column for example, is not a feature I think we'd want to allow within a default table worksheet. Resizing a column, on the other hand, would be allowed. The idea is that the default worksheet should let people see the raw table as it stored in PostgreSQL. No fewer columns, no more.

    So if you open a default table worksheet and then hide a column, you'd have the option to save the worksheet as new custom worksheet, somewhat like an exploration.

All of this is to say: I'd love to take this feature up. And I'd prefer that we do it after getting this worksheets groundwork laid first.

@seancolsen seancolsen added this to the Backlog milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: product approval It's not yet clear that this issue will actually improve Mathesar from a user's perspective needs: requirements The problem is clear and worth solving, but we're not yet sure of the best solution restricted: maintainers Only maintainers can resolve this issue type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Projects
None yet
Development

No branches or pull requests

2 participants