yangzhang75 opened a new pull request, #9334:
URL: https://github.com/apache/texera/pull/9334

   ### What changes were proposed in this PR?
   
   Closes #9257. Part of the Form View feature (#8011). The behaviour here is 
the one settled in the
   design discussion #9033.
   
   After a run the Form View can show several result cards, and nothing tied a 
card to the step that
   produced it. To find one step's result a reader read the card titles, and 
two steps with the same
   name gave two cards with the same title. The picker that decides which 
results show sat below the
   cards, away from both the preview and the results it is about.
   
   **Selecting a step leads the Results.** The selected step's card moves to 
the front, outlined in the
   colour the canvas draws round a selected step (`workflow-editor`'s 
`highlightOptions` stroke), so the
   move reads as "this is that step's result" rather than a reshuffle. The 
selection is the canvas's
   own: clicking a step on the embedded preview leads its card, and deselecting 
-- the panel's close
   button, empty canvas, a multi-select -- puts the cards back in their saved 
order. The card at the
   front is read from the selection rather than kept beside it; keeping a 
second copy let the two drift
   apart (hiding the selected step's result cleared the lead but not the 
selection, and its name then
   read as "already leading").
   
   **Each result becomes a chip with two targets.** The picker moves up to sit 
between the preview and
   the results. The step's name makes that same selection -- through 
`WorkflowActionService`, so a
   co-editor sees the ring exactly as they do for a canvas click -- and 
clicking the name of the step
   already selected lets it go. The eye beside it shows or hides that result: 
the author's default for
   everyone while editing (written to the config, as before), this page only 
otherwise, so a reader
   without write access can still hide a result they do not care about and 
bring it back. A hidden
   result has no card to bring up, so its name is marked unavailable and says 
why, while its eye stays
   live; that is how the result comes back.
   
   Nothing about the order is saved, and the preview is left as the reader had 
it: opening it from a
   name click moved the picker and the results about a third of the page down, 
out from under the name
   just clicked. The ring has a programmatic twin: the leading result's name 
carries `aria-current`, so
   a reader who cannot see the outline is still told which result is the one 
being looked at.
   
   **Known limitation, pre-existing:** a selection made while the preview is 
closed is not ringed on the
   canvas if the preview is opened afterwards. The editor draws only the 
highlights that arrive after it
   mounts, which is also why switching between the canvas and the Form View 
loses the ring on main. The
   step's property panel does open on it, so the selection itself is not lost.
   
   Not included, and raised in #9033: letting the author drag the results into 
an order in Edit mode.
   
   Two dead lines in files this PR already touches go with it: the rendered 
spec registered the `lock`
   and `unlock` ng-zorro icons, which no template reachable from that spec 
renders, and
   `workflow-form.component.spec.ts` imported `workspaceFormUrl` without using 
it.
   
   #### Video
   
   <!-- recording goes here -->
   
   ### Any related issues, documentation, discussions?
   
   - Closes #9257.
   - Design discussion: #9033, where this behaviour was settled (the lock that 
an earlier revision used,
     and the double click that let a step go, were both dropped there).
   - Part of the Form View feature #8011.
   
   ### How was this PR tested?
   
   Seventeen new unit tests in `workflow-form.component.spec.ts` and two in
   `workflow-form.rendered.spec.ts` (the rendered page asserts the picker's 
position between the preview
   and the results, and that the ring lands on the lead card and that step's 
chip and nowhere else). The
   harness gained a `highlightOperators` that models the real chain, so a name 
click goes through the
   action service, the wrapper replaces the selection, the highlight stream 
emits and the page's own
   handler runs, as for a canvas click.
   
   Full frontend suite on this branch, rebased on current main: 250 files, 7135 
tests, 1 skipped, all
   green. ESLint and Prettier clean on the changed files. Production AOT build 
passes. Every statement
   and every branch the commit adds is covered, checked line by line against 
the lcov report: 42/42
   statements and 16/16 branches, with no partially-taken branch on a changed 
line. Eleven mutations of
   the new behaviour -- the lead not moving, the ring on the wrong card, a 
hidden name acting, the eye
   writing a reader's choice to the config, the name and the eye wired to each 
other's handler, the
   `aria-current` twin going missing -- were all killed by the new tests.
   
   Checked by hand on a local stack against a ten-operator demo workflow with 
four results (a table and
   three charts): clicking a step on the preview, clicking a result's name, 
clicking it again, hiding
   the selected step's result and showing it again, and two browser tabs open 
on the same workflow to
   confirm the order and the eye are local to a page while the selection ring 
propagates as a canvas
   click's does.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01FVvP3ttj22f9LB4p9u2anY
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to