Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 3, 2025

Allows users to choose which data columns to include when exporting orders (CSV, Excel, Google Sheets). Users can select from: Order (basic info), Customer Details (attributes), Product Details, and Ingredient Details.

Changes

Settings Model (lib/ui/transit/order_widgets.dart)

  • Added selectedColumns: Set<FormattableOrder> to TransitOrderSettings
  • Persists selection to cache as column indices, defaults to all columns
  • Updated parseTitles() to return only selected columns

Settings UI (lib/ui/transit/order_widgets.dart)

  • Added "Export Columns" section with 4 checkboxes in settings dialog
  • Enforces minimum 1 column selection
  • Shows "X columns selected" in export header metadata

Export Logic

  • CSV export (lib/ui/transit/csv/export_order_view.dart): Uses selectedColumns instead of FormattableOrder.values
  • Excel/Google Sheets: Already compatible via parseTitles() method

Localization

  • Added transitOrderSettingColumnsLabel and transitOrderSettingMetaColumns strings
  • Supported in English and Chinese

Example

// Before: Always exports all 4 column types
final data = FormattableOrder.values.map((f) => orders.expand((o) => f.formatRows(o)));

// After: Exports only selected columns
final selectedColumns = settings.value.selectedColumns.toList();
final data = selectedColumns.map((f) => orders.expand((o) => f.formatRows(o)));

Tests

  • Widget test for column selection UI interaction
  • Export test verifying only selected columns appear in output
  • Cache persistence verification

Note

Requires make build-l10n to generate localization files from updated YAML.

Original prompt

Allow customize orders export columns, ex. Catalog can be optional, order id, order no... etc
Use checkbox on header of table to make user select, not sure if this is good idea, optimizing the ux as you think it supposed to be


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 3, 2025 13:52
Co-authored-by: evan361425 <14554683+evan361425@users.noreply.github.com>
Co-authored-by: evan361425 <14554683+evan361425@users.noreply.github.com>
Co-authored-by: evan361425 <14554683+evan361425@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow customize orders export columns, ex. Catalog can be optional, order id, order no... etc Use checkbox on header of table to make user select, not sure if this is good idea, optimizing the ux as you think it supposed to be Add customizable column selection for order exports Nov 3, 2025
Copilot AI requested a review from evan361425 November 3, 2025 14:03
Copilot finished work on behalf of evan361425 November 3, 2025 14:03
@evan361425
Copy link
Owner

Order my not be proper to customize, size the exported data can only be analyzed (not able to imported). Customized columns to export seams useless.

@evan361425 evan361425 closed this Nov 22, 2025
@evan361425 evan361425 deleted the copilot/fix-14554683-326313096-5a7596b5-9fd5-48c3-bf03-37494b43df80 branch November 22, 2025 07:26
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