mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

Add hyperlinks to Record Pages within PK and FK cells

Open seancolsen opened this issue 1 year ago • 4 comments

This PR adds small icon-based hyperlinks to PK cells and FK cells which point to Record Page URLs.

Demo

https://user-images.githubusercontent.com/42411/184432663-5a7497d8-0559-4572-9525-a8c4ca9ce6c2.mp4

Notes

  • The mockups within the Record Selector specs required the link to be inside the FK pill. This PR puts the link outside the pill. Notably, @kgodey originally wanted the link outside the pill, so I think she'll like this design alteration. I ended up going with "outside-the-pill" because Kriti was right -- "inside" did feel a bit funky once I saw it in the page. The "inside" approach also made it difficult to achieve visual consistency with the link in the PK cell, which I hadn't considered until working on this.

Checklist

  • [x] My pull request has a descriptive title (not a vague title like Update index.md).
  • [x] My pull request targets the master branch of the repository
  • [x] My commit messages follow best practices.
  • [x] My code follows the established code style of the repository.
  • [x] I added tests for the changes I made (if applicable).
  • [x] I added or updated documentation (if applicable).
  • [x] 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 avatar Aug 12 '22 19:08 seancolsen

Codecov Report

Merging #1525 (2a910c0) into master (9893df7) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1525   +/-   ##
=======================================
  Coverage   92.49%   92.49%           
=======================================
  Files         142      142           
  Lines        6305     6305           
=======================================
  Hits         5832     5832           
  Misses        473      473           
Flag Coverage Δ
pytest-backend 92.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 12 '22 20:08 codecov-commenter

The video looks good. I think it might make sense to left-align PK values and have the link right aligned to be consistent with FKs (so all values that are some sort of key have the same behavior, regardless of data type). That doesn't necessarily need to happen in this PR, though.

kgodey avatar Aug 12 '22 20:08 kgodey

@kgodey

left-align PK values

That's easy to do. Here, let's see how it looks. GIF below. (Press the play at the top right.)

Peek 2022-08-12 16-56

(Note that I sorted the table so as to give a more randomized sampling of PK values.) I'm not sure which I prefer, PK cells left aligned or PK cells right aligned @ghislaineguerin @pavish @rajatvijay do you have an opinion? I'll keep a commit locally with the change that left-aligns them and I'll push it if we decide to go with that.

seancolsen avatar Aug 12 '22 20:08 seancolsen

I do like that better. Also, I thought we had an issue somewhere to disable digit grouping separators by default for ID columns? I can't find it but I remember some sort of proposal about that from you, @seancolsen. I think that would be good to do in Cycle 3 or 4.

kgodey avatar Aug 12 '22 21:08 kgodey

@kgodey I pushed 776fe0cf95ed5d5207c8dc7c8892448f3b44fd99 to left-align the values, and I created #1527 to track the small task of removing the grouping separators.

seancolsen avatar Aug 15 '22 11:08 seancolsen

Thanks @seancolsen. I dug up the proposal from you that I was thinking of and made a comment in #1527.

kgodey avatar Aug 15 '22 16:08 kgodey

@seancolsen Feel free to merge this PR once the merge conflicts are resolved.

pavish avatar Aug 16 '22 17:08 pavish