Repository navigation
Add a locate button to the table list that centers the table on the canvas - #1199
Merged
1ilit merged 2 commits intoNov 13, 2026
Merged
Conversation
…anvas Finding a table in a large diagram meant panning around by hand, even though the side panel already lists every table. Each row in the tables tab now has a map pin button that selects the table, so it gets the usual blue selection border, and pans the canvas so the table sits in the middle of the view. The current zoom is kept. The button is disabled for hidden tables, since they are not drawn on the canvas. The pan target comes from a new getTableCenter helper that uses the same width and height calculations as the canvas. Rows are memoized, so the handler reads setTransform from a new TransformActionsContext (same pattern as the select, diagram and undo contexts) rather than the transform context. That way panning does not re-render every row. Closes drawdb-io#1198 Closes drawdb-io#1190 Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
|
@officialasishkumar is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1ilit
requested changes
Nov 11, 2026
1ilit
left a comment
Member
There was a problem hiding this comment.
instead of adding an icon can u locate the table when it's selected?
Replace the locate button with panning to the table when its panel is opened in the tables tab.
Contributor
Author
|
Done, the icon is gone and the canvas now centers on the table when you select it in the list (06d6cd7). |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a "Locate on canvas" (map pin) button to every row of the tables list in the side panel. Clicking it selects the table (so it gets the usual blue selection border) and pans the canvas so the table is centered in the view. The current zoom is kept.
Closes #1198
Closes #1190
Design notes
getTableCenterhelper inutils.js, built on the samegetTableWidth/getTableHeightthe canvas uses. The canvas pan is the center of the viewport in diagram space, so the table center is the pan value.setTransformfrom a newTransformActionsContext(the same pattern as the select, diagram and undo contexts). Panning therefore doesn't re-render every row.locate_table) is added; other locales fall back to English.Testing
The repo has no test runner, so I checked it this way:
eslint --max-warnings 0andprettier --checkon the touched files pass.vite buildsucceeds.