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

Add visual cues to foreign key columns #950

Closed
seancolsen opened this issue Jan 5, 2022 · 7 comments
Closed

Add visual cues to foreign key columns #950

seancolsen opened this issue Jan 5, 2022 · 7 comments
Assignees
Labels
ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Milestone

Comments

@seancolsen
Copy link
Contributor

seancolsen commented Jan 5, 2022

Current behavior

  • When viewing a table, the user has no indication which columns have foreign key constraints.

Desired behavior

  • Column header displays referenced table and referenced column.
  • Column header menu displays referenced table.
  • Cell values are stylized differently.

Notes

  • If two columns are both part of the same multi-column FK, then they should both receive the foreign key styling.

Specs

See also

@seancolsen seancolsen added needs: unblocking Blocked by other work type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory labels Jan 5, 2022
@seancolsen seancolsen added this to the [08] Working with Views milestone Jan 5, 2022
@seancolsen
Copy link
Contributor Author

@ghislaineguerin one small concern -- the cell styling of a background and border radius on the text looks great with simple numbers -- and I imagine styling will suffice in the vast majority of cases. But I wonder if it's worth considering the scenario where the FK value is a text that wraps within the cell. In that case the border radius won't look so good. Would it be better to apply the background color to the entire cell instead of just the text? Or perhaps the text-wrapping scenario will be rare enough to disregard?

@ghislaineguerin
Copy link
Contributor

ghislaineguerin commented Jan 10, 2022

@seancolsen I worry about how that might communicate that the records are 'linked,' meaning they exist elsewhere. My idea with separating them visually from the table was that. If we merge them into the cell, we are losing that. I'll test it out and see if we can work something out or test with wrapping to see how that looks.

@pavish
Copy link
Member

pavish commented Jan 11, 2022

FK value is a text that wraps within the cell

@seancolsen @ghislaineguerin
For cases where the FK value is a lengthy text, I'd suggest that we rather add ellipsis to the end instead of wrapping it.

  1. The cell height has to be explicitly mentioned and not controlled by the browser, to support virtual scrolling.
  2. Spreadsheets do not wrap text usually.
  3. The cell styling from the UX would work for all cases when we do not wrap text.

@kgodey
Copy link
Contributor

kgodey commented Jan 11, 2022

@pavish Won't we need to support different cell heights for the record preview feature? Also, how would editing the value work if the user can't see the whole value?

@pavish
Copy link
Member

pavish commented Jan 11, 2022

@kgodey

Won't we need to support different cell heights for the record preview feature?

  • Yes, we will be supporting this. This is possible because the cell heights for the preview feature can be calculated prior to rendering, considering that each key value pair takes a single line for itself within the cell. However, if the text is wrapped and can take any arbitrary number of lines per key value pair, we cannot estimate the space it would possibly take without rendering it first, which we cannot support and would not require.
  • We can provide options for users to still manually resize both the column and the row (similar to spreadsheets).

how would editing the value work if the user can't see the whole value

  • On edit mode, the user can see the entire value. This is the current behaviour as well, lengthier text is truncated on normal mode but on edit mode, it transforms into a textbox with the full value. For longer texts, we'll be using a textarea moving forward.

The interface I have in mind would work similar to airtable and would also satisfy our UX.

@kgodey
Copy link
Contributor

kgodey commented Jan 11, 2022

Okay, thanks, @pavish, sounds good to me.

@kgodey kgodey modified the milestones: [09] Working with Views, [08] Links Between Tables Jan 18, 2022
@seancolsen seancolsen self-assigned this Apr 20, 2022
@seancolsen seancolsen added ready Ready for implementation and removed needs: unblocking Blocked by other work labels Apr 20, 2022
@kgodey kgodey modified the milestones: [08] Links between Tables, Cycle 2 Jun 1, 2022
@kgodey kgodey modified the milestones: Cycle 2, Cycle 3 Jul 19, 2022
@seancolsen
Copy link
Contributor Author

I'm closing this ticket per a discucsion where we decided to pursue a simpler design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation type: enhancement New feature or request work: frontend Related to frontend code in the mathesar_ui directory
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants