Skip to content

Foreign key UI improvement PR #3 - #188

Merged
Leo-rq-yu merged 15 commits into
devAug31from
ui/foreign-key-2
Sep 6, 2025
Merged

Leo-rq-yu merged 15 commits into
devAug31from
ui/foreign-key-2

Conversation

@Leo-rq-yu

@Leo-rq-yu Leo-rq-yu commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor
video1984424314.mp4
image image

@Fermionic-Lyu Fermionic-Lyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few improvements:

  1. In RecordForm, for a uuid field with foreign key, the placeholder should not be 'Auto-genereated if empty'. This is mentioned in issues #174. Actually only a custom column with type uuid and default value gen_random_uuid() should display the 'Auto generated if empty' placeholder.

  2. You can remove the id column in RecordForm. We should not let user input that.

  3. When user clicks 'Open Table' in ForeignKeyCell, after navigation, you should clear the selected cell (or even better, the selected cell should be changed to the cell that is linked to, but that is optional for now)

  4. Double check row height with HH and Peter. 36px looks worse than the original 52px to me, but I'm good with it if both of them agree with the change

@Fermionic-Lyu Fermionic-Lyu linked an issue Sep 3, 2025 that may be closed by this pull request
@Leo-rq-yu Leo-rq-yu linked an issue Sep 3, 2025 that may be closed by this pull request
3 tasks done
@Leo-rq-yu

Copy link
Copy Markdown
Contributor Author

A few improvements:

  1. In RecordForm, for a uuid field with foreign key, the placeholder should not be 'Auto-genereated if empty'. This is mentioned in issues [Bug]: fk column shouldnt be auto-generated if empty #174. Actually only a custom column with type uuid and default value gen_random_uuid() should display the 'Auto generated if empty' placeholder.
  2. You can remove the id column in RecordForm. We should not let user input that.
  3. When user clicks 'Open Table' in ForeignKeyCell, after navigation, you should clear the selected cell (or even better, the selected cell should be changed to the cell that is linked to, but that is optional for now)
  4. Double check row height with HH and Peter. 36px looks worse than the original 52px to me, but I'm good with it if both of them agree with the change

I solved the comments #1 and #2. However, I still have trouble with the selected cell for now, since it is handled in the data grid.

video1653244025.mp4

@Fermionic-Lyu

Copy link
Copy Markdown
Member

In your video, test3 & test4 are still showing a placeholder "Auto-generated if empty". Do these two fields have default value gen_random_uuid()? What about a uuid column with no default value?

@Leo-rq-yu

Leo-rq-yu commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor Author

In your video, test3 & test4 are still showing a placeholder "Auto-generated if empty". Do these two fields have default value gen_random_uuid()? What about a uuid column with no default value?

The placeholder in test3 is incorrect. It should be Optional, and I fixed it. Then I saw that if the user creates a non-nullable UUID column, even without setting a default value, the current logic will change the default value to gen_random_uuid(), which leads to the "auto-generated" placeholder.

@Fermionic-Lyu

Copy link
Copy Markdown
Member
image

Looking at the picture, the height of the table content might be wrong. You can see content flowing below table headers. At the bottom, the pagination is incorrect. It is only showing the first page (50 rows), and I can't navigate to the next page if I have more than 50 records.

@Fermionic-Lyu

Copy link
Copy Markdown
Member
image

Looking at this picture, I can still click on the forbidden cell even though my cursor is in cursor disable state, and the Add Record button is enabled.

@Fermionic-Lyu

Copy link
Copy Markdown
Member
image

The clear search button is incorrectly styled in dark theme.

@Fermionic-Lyu

Copy link
Copy Markdown
Member
image

I can't create a record with customer_id left empty, even though it says 'Auto-generated if empty'

Comment thread frontend/src/components/radix/Badge.tsx Resolved
@Leo-rq-yu

Leo-rq-yu commented Sep 6, 2025 •

Copy link
Copy Markdown
Contributor Author
image I can't create a record with customer_id left empty, even though it says 'Auto-generated if empty'

I couldn't reproduce this error. I believe the new placeholder logic is more robust and less misleading. Could you try again in the same case?

Leo-rq-yu and others added 2 commits September 5, 2025 18:40
implement a more solid default value displayer in the furture

@Fermionic-Lyu Fermionic-Lyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I removed uuid placeholder logic to align with other column types. We should implement a new logic for displaying correct default values as placeholders in the future.

Make a note of all the unresolved comments and fix them in the next PR

@Leo-rq-yu

Copy link
Copy Markdown
Contributor Author

I removed uuid placeholder logic to align with other column types. We should implement a new logic for displaying correct default values as placeholders in the future.

Make a note of all the unresolved comments and fix them in the next PR

The next PR is mainly about assigning and displaying the default value. I'm working on that now.

@Leo-rq-yu
Leo-rq-yu merged commit cb6dc10 into devAug31 Sep 6, 2025
tonychang04 added a commit that referenced this pull request Sep 10, 2026
* chore(deps): vitest 4.1.11, nodemailer 9.1.1, js-yaml 4.3.2

Clears 7 of the 11 open Dependabot alerts on this repo. The remaining 4 are
covered below with reasons, not left silent.

  vitest          ^4.1.8 / ^4.1.6 -> ^4.1.11 in backend, packages/ui and
                  packages/dashboard (each declares its own)        2 alerts, dev
  @vitest/mocker  lifts to 4.1.11 with vitest
  nodemailer      ^9.0.3 -> ^9.1.1                                  4 alerts, runtime
  js-yaml         override 5.2.3 -> ^4.3.2                          1 alert, dev, HIGH

nodemailer is NOT the 6.x -> 9.x major the alert ranges imply -- the repo is
already on 9.0.3, so this is a patch bump. Note 9.1.1 rather than 9.1.0: alert
#192 covers "<= 9.1.0", so 9.1.0 would still be flagged.

js-yaml is the interesting one. The root override pinned 5.2.3, but every
consumer wants ^4.1.x (@eslint/eslintrc, cosmiconfig, csv-to-pg), so a 5.x pin
could not apply to them and the root copy sat on the vulnerable 4.3.1 while the
override looked like it had handled it. ^4.3.2 is the patched release in the
line they actually resolve, so the override now does what it claims.

NOT FIXED, and not fixable:

  adm-zip #188   GHSA-vwc7-r8mq-g2x9, ">= 0.5.9, <= 0.6.0", first_patched_version
                 NONE. 0.6.0 is the latest published version, so there is no
                 upstream fix to take. Needs a risk acceptance or a replacement
                 dependency, not a bump.

NOT FIXED, deliberately, both unchanged from #2048:

  qs #182/#183   express@4 -> [email protected] pins qs@~6.15.1 and the patch
                 is 6.16.0, outside it. Needs an express 5 major.
  csv-parse #187 dev-only, via pgsql-seed -> [email protected] -> csv-parse ^6.2.1.
                 pg-seed@latest still requires ^6.2.1, so there is no upstream
                 fix. The runtime path is already on 7.0.2.

Lock regenerated with npm 11 (`npx npm@11 install --package-lock-only`): npm
10.9.4 fails on this repo with `Cannot read properties of null (reading
'edgesOut')`, which reproduces on clean main with the lock deleted and is not
caused by this change. lockfileVersion stays 3 and `npm ci` under npm 10
installs it cleanly.

Verified: `npm ci` clean; `npm run typecheck` 8/8 turbo tasks; backend suite
203 files / 2,425 tests passed, 21 skipped. First run showed 1 failure that
did not reproduce on re-run -- flake, not this change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015uMMufpCJ4VqNeavrDHJim

* fix(deps): regenerate the js-yaml subtree so no stale edge survives

Greptile's P2 is correct, and I had noticed this and waved it off, which was
wrong. After the override moved from 5.2.3 to ^4.3.2, the lockfile still pinned
`node_modules/@eslint/eslintrc/node_modules/js-yaml` at 5.2.3 -- a version that
satisfies NEITHER the new override NOR @eslint/eslintrc's own ^4.1.1. A
lock-based install and a fresh resolve would therefore have produced different
trees.

Not a security issue: 5.2.3 sits above the vulnerable `>=4.0.0 <4.3.2` range.
It is a lockfile correctness issue, which is worth fixing on its own terms.

Dropped the stale node and re-resolved. There is now exactly ONE js-yaml, at
4.3.2, satisfying both the override and eslintrc.

Verified: `npm ci` clean; `npm ls js-yaml --all` reports 4.3.2 as `overridden`
and `deduped` with NO `invalid` nodes; `npm run typecheck` 8/8 turbo tasks.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015uMMufpCJ4VqNeavrDHJim

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

[Bug]: fk column shouldnt be auto-generated if empty [Feature] ReferenceCellPopover re-design

2 participants