Skip to content

improve behavior and test coverage of export fields#692

Open
marqode wants to merge 3 commits into
feature/tsv-exportsfrom
feature/export-field-updates
Open

improve behavior and test coverage of export fields#692
marqode wants to merge 3 commits into
feature/tsv-exportsfrom
feature/export-field-updates

Conversation

@marqode

@marqode marqode commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactors the Instance Export wizard across several dimensions:

  • reorganizes the export field groups from 6 to 8 groups: Primary Identity, Connectivity, Health & Updates, Compute & Storage, Business Logic, Advanced Infrastructure & Cloud, System IDs & Agent Logs, and Instance Hierarchy.
  • In the reorder step (step 2), each row now displays a badge indicating its parent group, and a "Reset to default order" button restores the original field sequence by capturing the initial order at mount time rather than referencing the live prop (which would have been a no-op).
  • In step 1, typing in the search field now automatically expands matching accordion groups instead of leaving them collapsed. The nested ternary rendering the accordion was replaced with a renderFieldGroups helper for readability. Test coverage was updated to reflect the groupTitle field on exported fields and extended with new cases for the badge, reset button, and auto-expand behaviour.

Release Impact

Pick the target branch (see RELEASES.md for the full model):

  • dev — internal testing → publishes to ppa-build-dev
  • main — next beta → publishes to ppa-build
  • release/YY.MM — point release on a maintained cycle → publishes to ppa-build-YY.MM (and to ppa-build-stable if this is the currently-promoted branch). Specify cycle: release/____

Change type (tick one):

  • Patch (fix)
  • Minor (feature)
  • Major (breaking)

The change-type label is informational and only affects how the entry is rendered in the CHANGELOG. The actual version is computed from the branch and CalVer cycle — pnpm changeset's patch/minor choice does not influence it.

Checklist

  • Changeset added — I have run pnpm changeset (or pnpm changeset --empty if no CHANGELOG line is warranted) and committed the resulting .md file. Required for PRs targeting main and release/*; enforced by the Changeset check workflow.
  • UI verified — I have verified the changes locally.
  • Linting clean — No linting errors are present (especially in scripts/).

Versioning Reminder

Important

Landscape UI uses CalVer (YY.MM.Point.Build). Version derivation by branch:

  • main / point/*YY.MM.0.<run>-beta
  • devYY.MM.0.<run>-dev
  • release/YY.MMYY.MM.1.<run> (cycle pinned by branch name)

@marqode marqode changed the title improve behavior and test coverage of export fields and sortable fiel… improve behavior and test coverage of export fields Jun 29, 2026
@marqode marqode requested a review from rubinaga June 29, 2026 19:08

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.

Pull request overview

Refactors the shared export wizard UX (used by instance/activity exports) to improve attribute grouping, reorder ergonomics, and test coverage—especially around field grouping metadata and search-driven accordion behaviour.

Changes:

  • Reorganized instance export attributes into 8 groups (and expanded the available fields) to improve discoverability.
  • Added groupTitle metadata to export fields so the reorder step can display a per-row group badge, plus added a reset-to-default ordering action.
  • Improved the attribute search experience by auto-expanding matching accordion groups, and added/updated tests for the new behaviours.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/features/instances/components/InstancesExportForm/constants.ts Reworks instance export field groups (new grouping + additional fields).
src/features/exports/types/ExportForm.ts Extends ExportField with optional groupTitle metadata.
src/features/exports/components/SortableFieldList/SortableFieldList.tsx Adds group badges in reorder rows and introduces a reset-order action.
src/features/exports/components/SortableFieldList/SortableFieldList.test.tsx New coverage for badges, reset behaviour, and ordering controls.
src/features/exports/components/SortableFieldList/SortableFieldList.module.scss Layout styles for the new reorder header + reset button.
src/features/exports/components/ExportForm/ExportForm.tsx Adds groupTitle when assembling selected fields and auto-expands groups on search via helper renderer.
src/features/exports/components/ExportForm/ExportForm.test.tsx New integration coverage for wizard flow, search auto-expand, badges, and reset behaviour.
src/features/activities/components/ActivitiesExportForm/ActivitiesExportForm.test.tsx Updates expectation to reflect search-driven auto-expansion (no manual accordion open needed).

Comment on lines +523 to +525
<i className="p-icon--restart" />
<span> Reset order</span>
</Button>
Comment on lines +1 to +7
import {
Button,
Chip,
Icon,
Input,
ModularTable,
} from "@canonical/react-components";
Comment on lines +363 to +370
{groupTitle && (
<Chip
value={groupTitle}
isReadOnly
isDense
className="u-no-margin--bottom"
/>
)}
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.

2 participants