refactor(mongo-editor): migrate to shared ResultPanel - #495
Merged
Conversation
…ltPanel Enables consumers to react to row selection (Mongo editor) and apply row-level styling (selected-row highlight) without forking the shared component. Purely additive — existing consumers pass neither prop. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Replace the legacy MongoDB result panel with the shared ResultPanel, injecting Mongo-specific behavior through toolbar/empty/cell slots: - Insert Document button + total/queryTime status (toolbar slot) - executed-success empty state (empty slot) - actions DropdownMenu (edit/clone/delete) + value cells (cell slot) - row-click highlight via new rowClassName prop Lift the three document modals (insert/edit/delete) and their mongoApi handlers from the deleted result-panel.vue into index.vue. Extract normalizeMongoResult + deriveMongoColumns pure utils with tests. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Superseded by the shared ResultPanel (commit 7f1f4a4). Removes 973 lines of Mongo-specific table/tree/json views, Monaco JSON editor and inline TreeNode that the shared component now covers. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…igration resultTitle, pageInfo, viewTable/viewTree/viewJson, actions, closePanel and selectCollection are no longer referenced after the migration to the shared ResultPanel (which renders its own labels) and the legacy result-panel.vue deletion. Verified zero references via grep before removing from enUS.ts and zhCN.ts. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #495 +/- ##
==========================================
+ Coverage 60.22% 60.28% +0.05%
==========================================
Files 121 122 +1
Lines 18935 18962 +27
Branches 880 885 +5
==========================================
+ Hits 11404 11431 +27
Misses 7268 7268
Partials 263 263
🚀 New features to boost your workflow:
|
Blankll
added a commit
that referenced
this pull request
Aug 14, 2026
## Summary Replace the MongoDB-style legacy DynamoDB result panel (`dynamo-editor/components/result-panel.vue`, 517 lines) with the **shared ResultPanel** (`@/components/result`) — the same component used by the Mongo editor (#495) and ES docs browser. Net effect: **−526 / +248**. ## Commits 1. **`refactor(dynamo-editor): migrate to shared ResultPanel`** - `ui-editor.vue`: shared panel, **offset-mode** pagination (`pageCount×pageSize` → `total`), `@update:page`/`@update:page-size` preserved - `sql-editor.vue`: shared panel, **cursor mode** — `@next-page` replaces data (`executePartiqlStatement` gains `mode: 'append' | 'replace'`, default append) - `#cell` slot injects edit/delete action buttons (same pattern as Mongo migration #495) - `delete-confirm-modal` lifted into both editors - new `utils/dynamo-result.ts`: `flattenDynamoColumns` (unrolls Primary Key group columns), `buildDynamoKeys`, `formatDynamoCell` 2. **`refactor(dynamo-editor): delete legacy result-panel, stop persisting result data`** - Delete `result-panel.vue` (517 lines) - `dbDataStore`: persist **only the query form** (`pick: ['dynamoData.uiQueryForm']`) — result panels start empty each visit (previously stale rows were resurrected from localStorage) - Remove 3 orphaned i18n keys ## Behavior notes - PartiQL pagination: "Load More (append)" → **next-page (replace)** — confirmed with user - Delete flow moved to editors; `deleteItem` store action still updates both caches ## Verification - `vue-tsc --noEmit` ✓ - `vite build` ✓ - No orphaned i18n references --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Summary
Replace the MongoDB-specific result panel (
mongo-editor/components/result-panel.vue, 973 lines) with the shared ResultPanel (@/components/result), reusing it via slots — the same component already used by the Elasticsearch docs browser.Net effect: −1030 / +297 lines.
Changes (4 commits)
feat(result)— Add@row-clickemit +rowClassNameprop to shared ResultPanel (purely additive; ES consumer passes neither).refactor(mongo-editor)— Migrateindex.vueto the shared ResultPanel via 3 slots:#toolbar: Insert Document button + total/queryTime status#empty: executed-success ✓ card#cell: actions DropdownMenu (edit/clone/delete) + value cells, row-click highlightmongoApihandlers intoindex.vuenormalizeMongoResult+deriveMongoColumnspure utils (utils/mongo-result.ts) with 18 TDD testsrefactor(mongo-editor)— Delete legacyresult-panel.vue(973 lines: custom table/tree/json views, Monaco JSON editor, inline TreeNode — all covered by the shared component).chore(i18n)— Remove 8 orphanededitor.mongo.*keys (verified zero references).Design decisions
:key="resultQueryId"forces remount (sharedusePaginationdoesn't watchdata).columnsfrom first-20-docs sampling (bypasses shared auto-derive which sorts + scans all rows).rowClassNamerender-prop;@update:page/@update:page-sizeclear selection.JsonView(Monaco readonly) is equivalent.Verification
vue-tsc --noEmit— exit 0vite build— exit 0index-docs-browser-body.vue) — zero references to new props (no regression)editor.mongo.*references