Skip to content

feat: add visible ER diagram entry button to database toolbar#119

Open
Blankll wants to merge 15 commits into
masterfrom
feat/er-diagram-entry-button
Open

feat: add visible ER diagram entry button to database toolbar#119
Blankll wants to merge 15 commits into
masterfrom
feat/er-diagram-entry-button

Conversation

@Blankll

@Blankll Blankll commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Adds a visible ER Diagram button to the database selector toolbar in the Queries page, so users can open the ER diagram view with one click instead of hunting through the right-click context menu on a table.

Changes

Commit 1: feat(sidebar): add ER diagram button to database toolbar

  • Added showErDiagram to ActionKind type in DatabaseSelectorRow.vue
  • Added ER diagram button (i-carbon-data-vis-3 icon) between the database selector and refresh button
  • Added i18n labels: sidebar.database.erDiagramTooltip (enUS + zhCN)
  • Button is disabled when no database is selected

Commit 2: feat(queries): wire ER diagram button to openErDiagramTab

  • Added showErDiagram handler in QueriesPage.handleDatabaseAction
  • Calls tabStore.openErDiagramTab(connId, db, schema) — same path as the existing context menu entry

Commit 3: chore: bump data-studio-agent to v0.1.4

  • Pre-existing dependency version bump

Before vs After

Before After
Select DB → expand schema tree → right-click a table → Show ER Diagram Select DB → click ER diagram button in toolbar

![ER diagram button location: next to refresh button, left of the more-actions dropdown]

Blankll and others added 15 commits July 22, 2026 23:23
Add a visible ER diagram button next to the refresh button in the database selector toolbar. Previously users could only access the ER diagram via right-click context menu on a table in the schema tree.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Handle showErDiagram action in handleDatabaseAction to call tabStore.openErDiagramTab with the active connection, selected database, and schema.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Remove standalone toolbar button, add 'ER Diagram' item to the database actions dropdown menu instead. This keeps the toolbar clean and groups all database-level actions together.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
When opening ER diagram from database toolbar, omit the schema parameter so all tables across all schemas are displayed instead of only the currently selected schema.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… replace emoji icons

- Zoom: use proportional scaling based on deltaY for better trackpad precision
- Toolbar: add zoom in (+) and zoom out (-) buttons with step factor 1.3x
- Schema: add schema selector dropdown before filter input, default 'All Schemas'
- Icons: replace 🔑🔗• emoji with clean inline SVG icons (key, link, circle)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Schema selector was not showing because available schemas may not be populated in the store yet. Add fallback to call databaseStore.fetchSchemas when cache is empty.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Replace empty string '' with '__all__' for the 'all schemas' option to avoid Radix Vue Select issues
- Reorder zoom controls to: zoom out → zoom in → percentage (matching user expectation)
- Add z-[100] to SelectContent to ensure dropdown renders above other elements
- Add schemaParam computed to map '__all__' → null for API calls

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Use invoke('list_schemas', ...) directly to avoid any Pinia store reactivity issues when the store hasn't cached schemas for the current database yet.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…eral

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ssues

- Click: remove opacity dimming on non-selected tables, just highlight selected + connected table cards
- Drag: add mouse-drag to reposition table nodes on the canvas
- Expand button: add whitespace-nowrap and increase button height to prevent truncation
- Nullable indicator: remove confusing circle icon (NOT NULL is the default assumption)
- Edge dimming: remove opacity reduction on non-highlighted edges

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… badges

- Orthogonal path routing: relationship lines now route around table cards with collision avoidance, replacing straight dagre edges

- Ctrl/Meta+Wheel zoom: zoom now requires ctrl/meta modifier, centered on mouse position. Plain wheel scrolls vertically

- Focus mode: clicking a table filters the view to only show the selected table and its directly related tables (via FK)

- Info badges: toolbar shows table count and relationship count badges

- Column marker alignment: non-PK/FK columns now get an empty spacer to keep all column text aligned

- Gesture support: added gesturestart/gesturechange handlers for trackpad pinch-to-zoom

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…verflow

- Drag: use dragDelta offset ref instead of updating nodePositions on every mousemove. Node positions and edge routes only update on drop. Eliminates shaking and position drift.

- SVG: add overflow=visible to prevent table clipping outside viewport during drag/pan

- Tooltips: add titles to tables badge, relationships badge, and layout direction button

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…uto-size, header drag

- Pure HTML rendering: replaced SVG+foreignObject with HTML div cards in an overflow:auto viewport with CSS scale zoom. SVG overlay used only for relationship lines (pointer-events:none)

- Header-only drag: drag now originates only from table header (cursor:grab). Uses delta-offset pattern, commits position on drop only

- Engineering mode: new entity-relationship view with rounded entities and column pills. Toggle via segmented control in toolbar

- Canvas auto-sizing: canvas dimensions computed from bounding box of all positioned tables. fitToScreen centers content

- Reset Layout: toolbar button restores dagre auto-layout positions

- View mode toggle: table view / engineering view switch preserving all interactions

- Native scroll pan: viewport uses overflow:auto, pan is native browser scroll. Ctrl+wheel zoom centered on mouse

- Extracted pure modules: types.ts, graph-routing.ts, graph-layout.ts with Jest TDD (32 new tests)

- TableCard.vue and EngineeringEntity.vue: presentational components with matching prop/emit interfaces

- All existing features preserved: schema selector, search, info badges, focus mode, layout direction, expand/collapse, orthogonal routing, large schema warning

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add right-click drag panning: hold right button on blank canvas area and drag to scroll the viewport. Prevents browser context menu during drag.

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.

1 participant