Repository navigation
fix(console): guard tablesdb column/index tabs when no table is selected - #15072
Conversation
|
Review complete. No blocking issues — approved ✅; 2 nitpicks below. 🧹 Nitpicks (2) — 🟢 2 low
This PR fixes the columns/indexes tab crash when no table is selected in the tablesdb workspace, mirroring the documentsdb guard, and adds a regression test that pins the guard via raw source-text matching.
The guard change is consistent with the existing documentsdb and vectorsdb patterns. Two low-severity review comments target the test's fragility: it asserts exact source text across an unrelated file, and its negative regexes match only one formatting of the unguarded pattern. Reviewed commit: 5dc90a3 |
New ConsoleProject ID: Tip Roll back Sites deployments instantly by switching between versions |
🟢 Tier S · Ready to mergeTablesDB Workspace now mounts the columns and indexes spreadsheets only when a table is selected. The pull request adds regression tests for loading and selected-table states, the required DOM/testing-library dependencies, and updated type-baseline entries. Latest changes: The newest commit removes the test-only translation mock so the regression test uses the actual i18n implementation.
📂 Walkthrough · 5
Reviewed the commits since |
Register happy-dom only for this file and restore module mocks after tests so other unit tests keep Node fetch and real module exports. Co-authored-by: Chirag Aggarwal <[email protected]>
|
@hansi-codes review |
The findings that requested changes are resolved. See the summary comment for what is still open.
bun's mock.module is process-wide and mock.restore() does not undo it, so the identity translateText mock leaked into i18n-dictionaries-load.test.ts and failed 'hebrew translates after the dictionary chunk loads' in CI. Workspace renders fine with the real translator (English passthrough).

Summary
TablesDB
WorkspacerenderedColumnsSpreadsheetandIndexesSpreadsheetwheneveractiveTabwascolumnsorindexes, even whenselectedTablewas undefined (for example while table detail is still loading, or when no table is selected).ColumnsSpreadsheetreadstable.$idon mount, which causedTypeError: Cannot read properties of undefined (reading '$id')(Sentry CONSOLE-V4-1RC).DocumentsDB and VectorsDB already guard these tabs with
selectedTable; the rows and documents tabs in TablesDB did as well. This change applies the same guard to columns and indexes.Test plan
bun test tests/unit/tablesdb-workspace-columns-tab-guard.test.tsFixes CONSOLE-V4-1RC
Related: appwrite-labs/cloud#5938