add some ux features#17
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
dbml-viz | cf8fb58 | May 19 2026, 03:27 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
dbml-viz-parser | cf8fb58 | May 19 2026, 03:27 AM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19bde7e3eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| columnsByTable: new Map([ | ||
| [selected.from.tableId, selected.from.columns], | ||
| [selected.to.tableId, selected.to.columns], | ||
| ]), |
There was a problem hiding this comment.
Union both endpoints for self-references
For a self-referential relationship, selected.from.tableId and selected.to.tableId are the same key, so the second Map entry overwrites the first. In schemas like employees.manager_id -> employees.id, selecting the edge only highlights the target column and drops the source/FK column from selectedRelationColumns, making the new relationship-selection affordance incomplete for common self-references. Merge the two column arrays when both endpoints are on the same table.
Useful? React with 👍 / 👎.
| sourceFocusStore | ||
| .getState() | ||
| .requestSourceFocus({ tableName: table.name }); |
There was a problem hiding this comment.
Preserve schema when focusing source
This sends only the bare table name to the source-focus locator. When the parsed schema has two schema-qualified tables with the same name, e.g. public.users and audit.users, clicking “Focus in Schema Source” for the second one still searches for users and focuses the first match in the document; the column action is fed the same bare table.name from TableNode. Include table.schema (or a stable table id/source range) so focus targets the selected table rather than the first table with that name.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf8fb58247
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const note: SharedStickyNote = { | ||
| id, | ||
| color: "yellow", | ||
| text: `#${table.name}\n`, |
There was a problem hiding this comment.
Generate unambiguous links for schema-qualified tables
When the schema contains duplicate table names in different schemas, this generated #${table.name} token is ambiguous because sticky-link resolution indexes tables by bare table.name and later entries overwrite earlier ones. In that case, choosing “Add sticky note for table” on public.users can create a note that links to audit.users (or another same-named table) instead of the selected table; the generated link needs to carry schema/id information or avoid claiming a table link when it cannot be represented unambiguously.
Useful? React with 👍 / 👎.
| return new RegExp( | ||
| String.raw`\b(?:CREATE\s+TABLE(?:\s+IF\s+NOT\s+EXISTS)?|Table)\s+` + | ||
| String.raw`(?:[\w"\x60.]+\.)?` + | ||
| String.raw`["\x60]?` + |
There was a problem hiding this comment.
Match bracket-quoted SQL Server identifiers
For SQL Server sources such as CREATE TABLE [users] or CREATE TABLE [dbo].[users], this locator never matches because the table regex only allows double quotes/backticks around the identifier and the optional prefix character class excludes brackets. The app exposes an mssql dialect, so “Focus in Schema Source” silently consumes the request without moving the cursor for common SQL Server schemas; include []-quoted identifiers in both the table and prefix patterns.
Useful? React with 👍 / 👎.
add features like focus/copy table nodes in editor, various state management and also legends etc