Skip to content

Add support for column commands and download source code. - #445

Merged
Jayson Maxson (jmaxson-ms) merged 25 commits into
mainfrom
user/jmaxson/columnCommands
Sep 22, 2026
Merged

Jayson Maxson (jmaxson-ms) merged 25 commits into
mainfrom
user/jmaxson/columnCommands

Conversation

@jmaxson-ms

Copy link
Copy Markdown
Contributor

What's new

New namespace: Microsoft.Performance.SDK.ColumnCommands

  • DataColumnCommands — sealed container that carries the optional commands available on a column. Exposes:
  • DataColumnCommands.Empty
  • TryGetDownloadSourceCodeCommand(out DownloadSourceCodeCommand)
  • DownloadSourceCodeCommand — abstract base a plugin implements to advertise "download source code" for a column value:
  • string CommandName
  • bool CanExecute(object value, string downloadPath)
  • Task ExecuteAsync(object value, string downloadPath, CancellationToken)
  • DownloadSourceCodeResult — result type with a success Uri (typically a local file URI the host opens) or a failure with ErrorMessage and optional attempted Uri.
    New interface: IDataColumnCommands
  • Implemented by DataColumn and HierarchicalDataColumn so hosts can retrieve the DataColumnCommands associated with any column.

Column builder integration

  • ColumnBuilder.WithCommands(DataColumnCommands) — attach commands to the built column, mirroring the existing WithVariants(...) pattern.
  • New WithToggle(..., DataColumnCommands) and WithHierarchicalToggle(..., DataColumnCommands) overloads on ToggleableColumnBuilder, plus equivalent overloads on ModalColumnBuilder and HierarchicalColumnBuilder, so commands can also be scoped to a specific variant.
  • DataColumn / HierarchicalDataColumn constructors accept an optional DataColumnCommands, and the runtime builders (EmptyColumnBuilder, ToggledColumnBuilder, ModalColumnWithModesBuilder) flow it through when materializing columns.

Design notes

  • DataColumnCommands is non-generic. The commands operate on object value because for hierarchical columns the row value may differ from T due to an ICollectionAccessProvider<T, TOut>. This is documented on the type.
  • DownloadSourceCodeCommand itself is non-generic for the same reason and to keep the host-side dispatch simple.
  • Commands were placed on the column (via IDataColumn / IHierarchicalDataColumn) rather than on ITableBuilder, because they are intrinsic column data (like ColumnConfiguration or the projection). The tradeoffs are captured inline in DataColumnCommands.cs.

Comment thread src/Microsoft.Performance.SDK/Processing/ColumnBuilding/ColumnBuilder`1.cs Outdated
Comment thread src/Microsoft.Performance.SDK/Processing/ColumnBuilding/ColumnBuilder`1.cs Outdated
@xj-ms

Copy link
Copy Markdown
Contributor

It seems your local git user isn't correctly configured that the commits weren't created with jmaxson-ms. Might want to fix it in the long run

Comment thread documentation/Using-the-SDK/Advanced/Adding-Column-Commands.md Outdated
@jmaxson-ms
Jayson Maxson (jmaxson-ms) merged commit 6afc40a into main Sep 22, 2026
5 checks passed
@jmaxson-ms
Jayson Maxson (jmaxson-ms) deleted the user/jmaxson/columnCommands branch September 22, 2026 16:55
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.

3 participants