The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
9709525f9b14a6b2ea05f0fce0156b9c09cd5e62 / yangzhang75 <[email protected]>
fix(frontend): make a result cell's download work off the canvas (#8539)

### What changes were proposed in this PR?

The download button on a result cell did nothing when pressed from the
Form View: the dialog opened, Export closed it, and no file arrived — no
request, no error, no message.

An export scopes itself to the operators selected on the canvas unless
the caller asked for all of them. That is the right scope for the two
callers that read the canvas: the top menu asks for everything, the
context menu exports the selection. The third caller is the download
button on a result cell, and a cell belongs to one operator, whoever
happens to be selected. The same cell is also mounted on the Form View,
where the selection holds the step the user is configuring and holds
nothing at all until they click one. There the export found an empty
scope, so `performExport` returned at its `operatorIds.length === 0`
check before sending anything. The dialog's own checks read the same
empty selection, so a restricted operator went unreported there too.

A caller that knows which operators it is exporting now says so, and
both the dialog and the service prefer that over the selection:

- `workflow-result-export.service.ts`: a trailing optional
`requestedOperatorIds` on `exportWorkflowExecutionResult`, threaded to
`performExport`. Precedence is `exportAll` (whole workflow) >
caller-named > canvas selection.
- `result-exportation.component.ts`: reads `operatorIds` off the modal
data; `getOperatorIdsToCheck()` returns it when present, and
`onClickExportResult` forwards it.
- `result-table-frame.component.ts`: the cell's dialog names the
operator whose results the frame is showing.

Nothing changes for the menu or the context menu, which name no
operators and keep the old scope. Ten lines of logic in three files.

### Any related issues, documentation, discussions?

Closes #8538, which has a recording of the before state.

One thing that PR does not change: `export-execution-result-enabled`
still defaults to `false` in `gui.conf`, and `performExport` returns on
that switch before it reaches any of this. A deployment with the switch
off sees no change from this PR; every deployment that has it on gets a
working cell download. Whether that default should flip is a separate
question and is noted at the end of the issue.

### How was this PR tested?

- Nine new unit tests across the three spec files: the service prefers a
named scope over the selection and works with an empty selection, falls
back to the selection when none is named, and still lets `exportAll`
win; the dialog names none by default, checks the named operator, and
hands it to the export; the frame names its operator, and names none
when it has none.
- Mutation check, each restored afterwards: dropping the named scope in
the service, in the dialog, or in the frame each turns exactly one named
test red.
- Coverage on the three changed files: 100% lines, functions and
branches, except one pre-existing unreachable branch elsewhere in
`result-table-frame.component.ts` that this PR does not touch.
- `ng test --watch=false`: 223 files, 6065 passed, 1 skipped
(pre-existing), 0 failed. `ng build --configuration=production` (AOT):
clean. `eslint` and `prettier --check` on all six files: clean.
- Exercised in a running instance built from this branch on top of
`main`: a Form View workflow whose result column holds binary files.
With the fix, the cell download sends `POST
/api/executions/result/export/local` and returns the bytes (4096 bytes,
HDF5 magic `89 48 44 46`, byte-exact) while the canvas selection is
empty. With the three production hunks reverted on the same stack, the
same click sends no request and produces no file within two minutes.

#### After the fix: downloading a result file from the Form View


https://github.com/user-attachments/assets/ba8da56b-429d-43d9-9961-aa078268e2d0

### Was this PR authored or co-authored using generative AI tooling?

Yes. Generated-by: Claude Code (Claude Opus 5, Anthropic). Co-authored
with Claude; the author reviewed the change before submission.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/36096885362

With regards,
GitHub Actions via GitBox

Reply via email to