Skip to content

#230 Export multiple selected objects - #4677

Open
vimace2003 wants to merge 10 commits into
dbeaver:develfrom
vimace2003:230-export-multiple-objects
Open

vimace2003 wants to merge 10 commits into
dbeaver:develfrom
vimace2003:230-export-multiple-objects

Conversation

@vimace2003

Copy link
Copy Markdown

Export was limited to a single object, while the metadata editor and the navigation tree both allow selecting several. The server exports one container per task, so a multi-object export is a list of export contexts sharing one processor configuration: one task and one download per object.

  • add ACTION_EXPORT to the object viewer footer menu, before Delete
  • export every selected node from the navigation tree context menu
  • resolve the connection per node, so a selection may span connections
  • skip nodes that are not data containers

vimace2003 and others added 2 commits September 18, 2026 18:39
Export was limited to a single object, while the metadata editor and the
navigation tree both allow selecting several. The server exports one
container per task, so a multi-object export is a list of export contexts
sharing one processor configuration: one task and one download per object.

- add ACTION_EXPORT to the object viewer footer menu, before Delete
- export every selected node from the navigation tree context menu
- resolve the connection per node, so a selection may span connections
- skip nodes that are not data containers
@codacy-production

codacy-production Bot commented Sep 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 23 complexity

Metric Results
Complexity 23

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved multi-selection and connection-loading issues remain, along with a critical lockfile/manifest mismatch.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds multi-object export support across the navigation tree and object viewer, creating one export task per selected data container.

Changes:

  • Builds export contexts for selected nodes and filters non-containers.
  • Supports multi-object dialogs, notifications, and per-node connections.
  • Adds object-viewer actions, localization, tests, and dependencies.
File Summary Review notes
webapp/​yarn.lock Updates workspace dependency metadata. Critical (1 vote): Lockfile records workspace:^ while the manifest declares workspace:*, causing immutable-install mismatch.
webapp/​packages/​plugin-object-viewer/​src/​index.ts Exports the footer menu identifier. No findings.
webapp/​packages/​plugin-data-export/​tsconfig.json Adds project references. No findings.
webapp/​packages/​plugin-data-export/​src/​locales/​en.ts Adds export labels. No findings.
webapp/​packages/​plugin-data-export/​src/​getNodeExportContexts.ts Builds contexts for eligible nodes. No findings.
webapp/​packages/​plugin-data-export/​src/​getNodeExportContexts.test.ts Tests context generation and filtering. No findings.
webapp/​packages/​plugin-data-export/​src/​Dialog/​useDataExportDialog.ts Starts exports for multiple contexts. No findings.
webapp/​packages/​plugin-data-export/​src/​Dialog/​ProcessorSelectDialog.tsx Displays multi-object subtitles. No findings.
webapp/​packages/​plugin-data-export/​src/​Dialog/​DataExportDialog.tsx Accepts context arrays. No findings.
webapp/​packages/​plugin-data-export/​src/​DataExportMenuService.ts Adds navigation and object-viewer export actions. Moderate (2 votes): Applicability checks only the clicked node, preventing exports when it is a non-container. Moderate (2 votes): Tree menu context lacks the selected-node provider, so multi-selection falls back to one node. Moderate (1 vote): Uncached connections are not loaded before resolving export contexts.
webapp/​packages/​plugin-data-export/​package.json Adds dependencies and test tooling. No findings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread webapp/packages/plugin-data-export/src/DataExportMenuService.ts
Comment thread webapp/packages/plugin-data-export/src/DataExportMenuService.ts
sergeyteleshev and others added 3 commits September 22, 2026 15:20
Review follow-up: the tree context menu never saw more than the clicked node,
so a multi-selection still exported a single object.

- publish the tree selection as DATA_CONTEXT_NAV_NODES in TreeNodeMenu: the
  menu context inherits from the view context, not from the node context where
  the selection was being set, so getNodesFromContext always fell back to the
  clicked node
- offer Export when any node of the selection is exportable, instead of
  requiring the clicked node to be one
- rename TreeNodeMenuProps to ITreeNodeMenuProps, required by the naming
  convention rule now that this file is part of the change

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Uncached connections can cause selected objects to be silently skipped during export.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
Resolved since last review (1)

Comment thread webapp/packages/plugin-data-export/src/DataExportMenuService.ts Outdated
Review follow-up: getConnectionForNode only reads the resource cache, so a
selected object whose connection was not cached yet was skipped silently, and
the footer could look like it did nothing when every connection of the
selection was uncached.

The objectId of a navigator node carries the datasource id at every level, so
derive the key with getConnectionIdForNodeId and load it. Each connection of
the selection is resolved once.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Four moderate issues remain in multi-selection handling, connection-failure isolation, and unique export naming.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread webapp/packages/plugin-data-export/src/DataExportMenuService.ts Outdated
…n fails

Review follow-up: a rejected connection load aborted the whole dialog, so a
single unavailable connection cancelled the export of every other selected
object, contradicting the contract of skipping nodes without a resolvable
connection.

The failure now skips only the objects of that connection and is reported
once per connection, instead of once per object.
…e state

Review follow-up covering the rest of the batch-export path:

- disambiguate file names when two selected objects share a connection and
  name (e.g. two "users" tables in different schemas), instead of letting
  withTimestamp's one-second resolution produce identical file names
- keep the dialog open while a batch is running, matching the footer buttons
  that were already disabled during export, so closing it can't be used to
  "cancel" while the loop keeps starting further tasks
- snapshot the processor/output settings once before the batch starts: the
  configuration forms stay editable while it runs, so reading them live could
  export different objects with different settings from a single click
- only toast per-object failures when at least one object did start; when the
  whole batch fails, report it once inline instead of once per object plus
  inline
- notify once when a selected node's connection can't even be identified, the
  one remaining silent-drop path in getExportContexts
- resolve every distinct connection in parallel instead of one sequential
  round trip per node, and simplify the per-node bookkeeping with a plain
  connection id instead of linear equality scans
- short-circuit the tree menu's isApplicable on the common case (the clicked
  node itself is exportable) before scanning the whole selection
- stabilize TreeNodeMenu's selection getter with useCallback: the data
  context link reruns every render, and a new function reference was
  invalidating every menu computed that reads the selection on each render

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Four moderate findings remain unresolved.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Preserve multi-selection when opening the row menu

webapp/​packages/​plugin-navigation-tree/​src/​NavigationTree/​ElementsTree/​NavigationTreeNode/​TreeNodeMenu/​TreeNodeMenu.tsx:50

This getter cannot preserve a navigation-tree multi-selection: opening the row menu calls treeNodeContext.select() from NavigationNodeControl/ConnectionNavNodeControl, which invokes tree.select(..., false) and clears the other selected nodes before this callback is read. As a result, exporting from a selected group exports only the clicked node. Preserve the existing selection when opening the menu (or capture the selected nodes before calling select).

Review follow-up: right-clicking a node collapses the tree selection to just
that node before the menu even opens (NavigationNodeControl/
ConnectionNavNodeControl call treeNodeContext.select() unconditionally on
context-menu open, which is a single, non-multiple select). So exporting
from a multi-selected group via the context menu only ever exported the
clicked node, no matter what the menu itself reads.

Only replace the selection when the clicked node isn't already part of it,
matching the usual desktop convention: right-clicking inside an existing
multi-selection keeps it, right-clicking outside it starts a new one.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Three moderate findings and one nit remain unresolved.

Review effort: Lite
Findings: None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external For external PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants