Skip to content

🗃️ Structure import#2504

Draft
AndyScherzinger wants to merge 15 commits intomainfrom
feat/noid/structureImport
Draft

🗃️ Structure import#2504
AndyScherzinger wants to merge 15 commits intomainfrom
feat/noid/structureImport

Conversation

@AndyScherzinger
Copy link
Copy Markdown
Member

WIP for CI execution/checks

@AndyScherzinger AndyScherzinger added enhancement New feature or request 2. developing Work in progress labels Apr 20, 2026
@AndyScherzinger AndyScherzinger force-pushed the feat/noid/structureImport branch 6 times, most recently from 4740f30 to bca53a5 Compare April 21, 2026 18:28
@AndyScherzinger AndyScherzinger modified the milestone: v2.1.0 Apr 24, 2026
…rison

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…ges atomically

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…er works

The <input> was inside <template #actions> which gets unmounted when the
menu closes. Moving it to the default slot keeps it in the DOM so
.importStructureFileInput.click() can open the file picker.

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…rted {id} template

generateOcsUrl() does not support {id} placeholder substitution — it just
prepends the OCS base path. The literal string '{id}' was being included in
the URL, causing 404s silently swallowed by the catch blocks.

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…tations

StructureDiffService was returning a flat structure that ImportStructurePreview
was unable to render:

- tableMeta: was {changes: [{field, current, incoming}]}, now {field: {current, incoming}}
- columns add: was {action, sourceId, title, type, details}, now {action, column: <srcCol>}
- columns update: was {action, sourceId, targetId, title, type, changes: [{field,...}]},
  now {action, targetId, column: {title, type}, changes: {field: {current, incoming}}}
- columns delete: was {action, targetId, title, type},
  now {action, targetId, column: {title, type}}
- views add: was {action, title, details}, now {action, view: <srcView>}
- views update changes: was [{field, current, incoming}], now {field: {current, incoming}}

Updated StructureDiffServiceTest assertions to match the corrected shapes.
Also removed the :disabled guard that prevented Preview from firing without
a selected file — replaced with a showWarning call inside the handler.

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…ogic

AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AI-assistant: Copilot 1.0.6 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger force-pushed the feat/noid/structureImport branch from bca53a5 to d6ec125 Compare April 25, 2026 15:56
@Koc
Copy link
Copy Markdown
Contributor

Koc commented Apr 29, 2026

hey @AndyScherzinger!

Thank you for working on this. Really good feature that nice to have. Few points from my side:

  • Let's wait before #1840: API structure improvement: expose columns through a technical name/slug/alias #2428 and Feat: Add technicalName to views #2547 got merged? I guess it's pretty logical to use this technicalName as a unique key for upserting columns and view. This will allow us to properly handle columns renaming (for now we're deleting old column and creating new one in case of rename. This causes data loss)
    image
  • It's hard to understand what exact was changed in view, see previous screen
  • Don't know, is it something wrong with my screen/styles, but new title almost not readable for me
    image
  • We already have possibility to create table from scheme, see \OCA\Tables\Controller\ApiTablesController::createFromScheme. Do you plan to change this controller as well to use newly created service ApplySchemeService? IMHO it has sense to reduce code duplication.
  • Not sure that we need this for the 1st iteration, but it has sense to use something like Optimistic Locking to prevent applying changes on a table that was recently changed by another user between we pressed "preview" and "apply"
  • For some settings I have changes in diff preview but actually nothing changed (Number column, min 0 -> 0)
    image
  • It doesn't support column reordering that you've added recently 🔢 Reorder and sort table columns #2481

@AndyScherzinger
Copy link
Copy Markdown
Member Author

Hi @Koc

Thanks a lot for the testing and review. All very good points to look into and address. The clear identification of column would be neat to have and makes updating structures easier. Yet for existing ones some/improved heuristic drill might make sense, else you can't make use of this on legacy table structures but that could be a limitation to accept. Maybe.

The colors aren't correct yet, first wanted to to get it working, right, polished. In that order and the current state is still very much in progress.

The issues at the end are currently issues of default values that don't get exported but a target value gets computed, so a difference is detected...

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

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants