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

   ### What changes were proposed in this PR?
   
   Closes #8026. Part of the Form View stack (parent issue #8011), on main. 
This is the first half of what was #8455 (closed, split in two at 2200 lines); 
the second half, authoring the inputs themselves, is __PR15B__ stacked on this 
one. Two commits: `425ee0a82` is the feature; `e3242c4e3` is a test-only 
follow-up for the Windows CI leg (last bullet). The tip is `e3242c4e3`.
   
   Adds the edit mode of the page and the page-level authoring it enables.
   
   - `toggleAuthoring`: with write access, Edit turns the page into in-place 
authoring; Done returns it to the reader state. Edit mode is the only state 
that enables workflow modification here (`applyEditability`), and entering it 
is refused without write access at the method itself, not only by hiding the 
button.
   - The inspect panel goes live in edit mode: it acts as an editor 
(`actsAsEditor`), its expose tick boxes are on (`exposeChoosing`), and `inert` 
comes off, so the author opens a step on the embedded preview and chooses which 
of its settings people fill in right there. It stays inert and read-only for 
everyone else, as before.
   - The embedded preview's right-click menu carries the structure lock. The 
menu's re-shaping commands followed the modification flag alone, so re-enabling 
it for the panel would have offered cut, paste, delete and disable on the 
structure-locked preview. `texera-context-menu` now takes `[structureLocked]` 
from the editor and gates those on modification AND no lock (`canModify`); 
copy, the result toggles, execute-to and export do not re-shape the graph and 
are unchanged.
   - Write the author's instruction in place: the heading is edited in the 
header (a row rather than one button, so the input is not nested in a control) 
and the body as markdown with Write / Preview tabs. A reader still sees it 
rendered, only when there is text.
   - Pick which extra results to feature: the picker offers the non-terminal 
steps that have view-result on the canvas (plus already-chosen ones) and 
rebuilds live when an eye is toggled. The final step's result always shows, so 
it is not offered.
   - Open canvas 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. A 
failed save keeps the author on the form with the error shown; a reader with 
nothing to save goes straight through. (#8456 does the same on the canvas side.)
   - Keyboard focus is visible on the pill and tab buttons (`:focus-visible`).
   - `e3242c4e3` (test only, workspace menu): the menu's export test 
module-mocked the CommonJS `file-saver` package with `vi.mock`. Under the 
Angular unit-test builder that call is not reliably hoisted (Vitest warns about 
it on every platform), and with this stack's shared-chunk graph it stopped 
applying on the Windows leg (7 of the last 8 Windows runs of the unsplit PR, 
while main passes). The export now goes through the existing injectable 
`FileSaverService`, as the dashboard downloads already do, and the spec stubs 
that with TestBed. No behaviour change.
   
   Not in this PR: renaming, hiding, reordering, help text and removal of the 
exposed inputs, and the author's view of a broken input. Those are __PR15B__.
   
   ### Any related issues, documentation, discussions?
   
   Closes #8026. Part of the Form View feature (parent issue #8011). Replaces 
the first half of #8455.
   
   ### How was this PR tested?
   
   Unit tests (vitest). Direct-construction tests cover the authoring gate 
(enter, leave, refused without write access, always allowed to leave), the 
result picker's range and its live rebuild on an eye toggle, the result toggle 
and instruction writes going through the binding service, and the switch's 
save-then-navigate order (navigates on complete, stays on error, straight 
through for a reader). The rendered spec covers the edit-mode header shape 
(title input outside the toggle, `aria-controls`) and the panel turning live in 
edit mode (editor on, tick boxes on, inert off). The context menu's spec 
renders it under a structure lock with modification enabled and checks cut, 
paste, delete, disable and enable are off while copy and the result toggle 
stay; the editor's spec opens the right-click menu on a locked editor and 
checks the lock arrived. Each new guard was deletion-checked (removing it turns 
the corresponding test red). eslint, prettier and the production (AOT) build 
pass; ever
 y changed line is statement and function covered.
   
   #### Screenshot
   
   (edit mode header with the instruction editor and the result picker; to be 
added)
   
   ### 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
   


-- 
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