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

Head commit for run:
5042d96ec85d98ed18bde841b2e74922c43f5c3b / yangzhang75 <[email protected]>
feat(gui): wire the Form View entry points (#8456)

### What changes were proposed in this PR?

Closes #8028. Part of the Form View stack (parent issue #8011), on main
now that #8516 and #8517 have merged. The review commit is the branch's
single commit.

Wires the Form View entry points. The flag stays off here; the stack's
closing PR, #8528, flips it.

- The dashboard opens a workflow in its `default_view` (form or canvas),
with a toggle that persists the choice; the deep link goes to the
existing `/workflow/:id/form` route. Both renderers of the dashboard,
the list row and the card, follow one shared rule
(`default-view-landing.ts`: mark, deep link, toggle), so switching the
view mode does not lose the entry point. The toggle is offered only with
WRITE access, which the endpoint requires, and the handler checks the
same rule rather than trusting the template; it is a proper toggle
button (constant accessible name, state in `aria-pressed`, the hover
title spelling out what a click does); hub links are left untouched.
- The canvas menu gains the same Canvas / Form View switch the form
already shows, so the two views swap in place. It saves first and hands
over only once the save has completed: the switch is a full-page load,
which aborts a request still in flight. Two more things the hand-over
must not lose: an autosave already in flight when the switch is clicked
(`WorkflowPersistService` now sends saves one at a time and in call
order, at the one place every save goes through, so the switch's save
lands and completes after it; each caller still gets only its own result
and a failed save does not hold up the next), and an edit made while the
switch's save is out (the page stays editable until the load;
`workflowChanged` marks it and the hand-over saves once more before
leaving). A reader, who cannot save, goes straight over. A workflow the
canvas holds but has never saved (the default id) is created by that
save, and the hand-over opens the id the save answered with. On the card
the toggle sits in the always-visible action footer, in the same slot as
on the row (right after Detail); the row's hover-revealed action group
also appears while the row has the keyboard focus, so the toggle can be
reached without a pointer there too. A second click while the hand-over
is in progress is a no-op. A failed save keeps the user on the canvas
with the error shown. Every workflow offers both views whenever the flag
is on: `default_view` only decides the landing view, and neither view
gates the other.
- Download/upload round-trips `defaultView` as a sibling key next to the
workflow content, in one shared export shape (`exportedWorkflow`) used
by the dashboard download and the canvas menu's export alike; an old
export without the key imports unchanged.
- The computing unit the user picks is remembered per workflow
(localStorage) so it survives switching between the two views; a unit
selected on load (the remembered one, the last execution's, a running
one) is derived rather than chosen and is not stored, or a derived unit
would later outrank a fresher last execution. On load the remembered
unit is honoured only once the unit list has arrived and still holds it:
a unit that has since been terminated is forgotten and the last
execution's unit is used instead, and a decision still pending when the
workflow changes underneath it is dropped (the remembered-unit check,
the last-execution lookup and its running-unit fallback alike).

### Any related issues, documentation, discussions?

Closes #8028. Part of the Form View feature (parent issue #8011).

### How was this PR tested?

Unit tests (vitest) cover the menu's Canvas / Form View switch through
the DOM (absent with the flag off, Canvas pressed, Form View handing
over, hidden while an older version is displayed), the row's and the
card's default-view behavior (mark and deep link, hub link untouched,
flag off leaves the dashboard as today, WRITE-only toggle in the DOM,
toggle on / off / failed request / no cached row), the menu switch
(navigates only once the save completes, stays on the canvas with the
error when it fails, saves once more when an edit lands while its save
is out, takes a reader straight over without a save, ignores a second
click mid hand-over), the canvas export carrying `defaultView` next to
the content and omitting it when unset, the hand-over opening the id the
save assigned when the canvas held a never-saved workflow, the persist
service sending saves one at a time in order with each caller getting
its own result and a failure not holding up the next, the dashboard
toggle handlers refusing without WRITE access, the toggle's aria-pressed
following the state, the export/import round-trip including a legacy
file without `defaultView`, and the computing-unit recall (waits for the
first non-empty unit list, forgets a terminated unit and falls back,
drops a stale decision after the workflow changed, a late last-execution
answer or fallback included, positive-integer validation, storage
failures, only an explicit pick remembered). Each new guard was
deletion-checked (removing it turns the corresponding test red). eslint,
prettier and the production (AOT) build pass; every changed line,
template lines included, is statement and function covered.

#### Video

##### 1. Default view on the dashboard
(row and card toggle, Form View icon, deep link into the form, toggle
off again, no toggle without write access)


https://github.com/user-attachments/assets/04f71ba5-27ad-489d-a5be-51cdd8d811aa



##### 2. Canvas / Form View switch
(save first, then the hand-over; and back)


https://github.com/user-attachments/assets/39c3d395-6329-403d-9719-ca7ef179889f


##### 3. Computing unit remembered across the switch


https://github.com/user-attachments/assets/6fe70b5f-d936-4333-bcf0-b3fa44f84323


##### 4. Download / upload keeps the default view


https://github.com/user-attachments/assets/0519bfcd-0677-478f-866c-6eb0350d842c


##### 5. Default view on the card view
(the same toggle in the card's action row, Form View icon, deep link
into the form)


https://github.com/user-attachments/assets/471192b3-7935-4da9-be87-fa08a7dd6c13



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

Yes. Generated-by: Claude Code (Claude Fable 5.1, Anthropic).
Co-authored with Claude, reviewed line by line by the author before
submission.

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

https://claude.ai/code/session_01FVvP3ttj22f9LB4p9u2anY

Co-authored-by: Claude Fable 5.1 <[email protected]>

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

With regards,
GitHub Actions via GitBox

Reply via email to