Add Word table cell DSL support#70
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17200ed7e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Add-Type -AssemblyName System.Drawing | ||
| $bitmap = [System.Drawing.Bitmap]::new(8, 8) |
There was a problem hiding this comment.
Remove System.Drawing dependency from cross-platform test
This test now creates a bitmap via System.Drawing, which is not supported on PowerShell 7/.NET 8 Linux and macOS environments, so Bitmap construction can throw before the table-cell assertions run. Because the main test workflow runs the suite on Ubuntu and macOS (.github/workflows/test-powershell.yml), this introduces a likely CI break unrelated to the feature itself; use a cross-platform image fixture approach (for example embedded PNG bytes or ImageSharp) instead.
Useful? React with 👍 / 👎.
| if (CurrentTableCell != null) | ||
| { | ||
| return CurrentTableCell; |
There was a problem hiding this comment.
Resolve paragraph host to current table cell first
RequireParagraphHost() checks header/footer before CurrentTableCell, so when WordTableCell -Table ... is used inside an active header or footer scope, commands like WordParagraph, WordText, and WordImage inside the cell block target the header/footer instead of the selected cell. This silently writes content to the wrong container in mixed scopes; the cell scope should take precedence (or this combination should be rejected explicitly).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2afe26d883
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| protected override void ProcessRecord() | ||
| { | ||
| var context = WordDslContext.Require(this); | ||
| var table = Table ?? context.CurrentTable; |
There was a problem hiding this comment.
Resolve current table scope from innermost frame
When WordTableCell is called inside a nested WordTable block, var table = Table ?? context.CurrentTable; can bind to the outer table instead of the nested one, because scope lookup is based on the oldest matching frame in WordDslContext. In that scenario, row/column addressing is applied to the wrong table (or throws out-of-range), so nested-table cell authoring is unreliable unless users always pass -Table explicitly.
Useful? React with 👍 / 👎.
| Add-Type -AssemblyName System.Drawing | ||
| $bitmap = [System.Drawing.Bitmap]::new(48, 48) |
There was a problem hiding this comment.
Avoid System.Drawing dependency in table-cell example
This example now requires System.Drawing to generate an image fixture, but System.Drawing.Common is not supported for general use on Linux/macOS in PowerShell 7/.NET 8, so the script can fail before demonstrating the DSL behavior on non-Windows hosts. Because this is a user-facing example for a cross-platform module, the image fixture should come from a static PNG (or another cross-platform library) instead of runtime bitmap generation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f80888a383
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Add-Type -AssemblyName System.Drawing | ||
| $bitmap = [System.Drawing.Bitmap]::new(48, 48) |
There was a problem hiding this comment.
Replace System.Drawing in published table-cell example
The website-facing example still depends on System.Drawing (Add-Type + Bitmap), which is not supported for general cross-platform use in PowerShell 7/.NET 8 on Linux and macOS; users copying this snippet can fail before any WordTableCell logic runs. The source example was already switched to a fixture image, so this generated artifact should be updated/regenerated to match that cross-platform approach.
Useful? React with 👍 / 👎.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
What changed
Add-OfficeWordTableCellfor cell-scoped authoring in the Word DSLWhy
These changes cover the table-cell authoring gaps identified during the issue review so users can build richer Word tables without dropping down to raw objects.
Validation
dotnet build Sources/PSWriteOffice.slnInvoke-Pester Tests/WordDsl.Tests.ps1 -Output DetailedNotes