You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "yangzhang75 (via GitHub)" <gi...@apache.org> on 2026/09/11 18:22:27 UTC
[PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994285623
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +548,18 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Lock or unlock editing: the graph and its properties are read-only unless a writer is in edit
+ * mode, which is the only state that unlocks them (see toggleAuthoring).
*/
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ // Edit mode with write access is the only state that makes the operator properties (and the
+ // embedded canvas) modifiable here; every other state locks them, so a reader -- or a writer
+ // just viewing -- cannot change the workflow through this page.
+ if (this.authoring && this.canEdit) {
Review Comment:
Entering Edit while a run is already in progress re-enables workflow modification here, undoing `ExecuteWorkflowService`'s running-state lock. The Edit button remains enabled during execution, so this lets the live property panel and view-result command mutate the workflow mid-run, contrary to the stated canvas lock behavior. Keep modification disabled until the run reaches a terminal state.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1278,11 +1451,24 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* of yourself, broken runs. A fresh document is the reliable handover.
*/
public openRegularCanvas(): void {
- this.save();
- /* v8 ignore start -- full-document navigation; jsdom cannot navigate */
+ // Save first and hand over only once the save has completed: the full-page load unloads this
+ // document, and a request still in flight at that moment is aborted, so navigating right after
+ // firing the save could lose the very edit the switch is meant to carry across. A save that
+ // fails keeps the author here with the error shown, rather than leaving with changes that were
+ // never stored. A reader, who has nothing to save, goes straight over.
+ this.save(() => this.openCanvasPage());
Review Comment:
This waits for the newly started save, but it does not coordinate with an autosave already in flight. Under a slow/out-of-order network, an older autosave can reach the backend after this latest snapshot and overwrite it; navigation then proceeds because only this request completed. Serialize/flush persistence requests and navigate only after the latest queued snapshot is committed.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 merged PR #8516:
URL: https://github.com/apache/texera/pull/8516
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994390842
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1301,40 +1526,56 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* workflow when the payload has no id, so saving whatever the graph holds would spawn
* stray "Untitled workflow" rows when the page is left before its workflow loaded.
*/
- private save(): void {
+ private save(afterwards?: () => void): void {
// A read-only viewer can open and run the form (execution is gated on computing-unit access,
// not workflow access) but must never persist: every such save is a guaranteed 403 that would
// spam "Could not save" on each debounce. Their inputs are non-editable, so nothing is lost.
+ // `afterwards` runs once the save has completed, or at once when there is nothing to save;
+ // it does not run when the save fails, so a caller that navigates on it stays put instead.
if (!this.canEdit) {
+ afterwards?.();
return;
}
if (!this.userService.isLogin() || !this.workflowPersistService.isWorkflowPersistEnabled()) {
+ afterwards?.();
return;
}
const workflow = this.workflowActionService.getWorkflow();
if (workflow.wid === undefined || workflow.wid !== this.wid) {
+ afterwards?.();
return;
}
+ if (this.destroyed) {
+ // On the way out there is no page left to queue on, and the request must NOT be tied to this
+ // component: ngOnDestroy calls save(), and untilDestroyed would tear the subscription down as
+ // part of the very same destroy sequence, aborting the request that was the point of the
+ // call. The persist is a one-shot HTTP request that completes on its own, so it needs no
+ // teardown operator; the error is reported inside persistNow.
+ // eslint-disable-next-line rxjs-angular/prefer-takeuntil
+ this.persistNow().subscribe({ error: () => undefined });
Review Comment:
This destroy-time save bypasses `persistQueue`, so it can run concurrently with an autosave already in flight. Unsubscribing that older HTTP observable after `ngOnDestroy` returns cannot guarantee that the backend cancels a request it already received; the older snapshot can still commit after this final snapshot, recreating the out-of-order overwrite the queue was added to prevent. Preserve ordering during teardown—for example, queue captured snapshots in a drain that may outlive the component—instead of starting an uncoordinated persist.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +545,41 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked by the execute service once it ends.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
+ this.workflowActionService.disableWorkflowModification();
Review Comment:
`ExecuteWorkflowService.updateExecutionState()` enables modification before it updates and emits the terminal execution state (`execute-workflow.service.ts:371-379,385-393`). Consequently, when a run completes this callback still sees the component's previous `Running` state, disables modification again, and the later execution-state handler never reapplies editability. Edit mode therefore remains locked after every run. Reconcile editability after assigning `current.state`, and make the regression test emit the unlock before the completion event to match production ordering.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3993095023
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -539,14 +570,51 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
return ["TEXTAREA", "SELECT"].includes(active.tagName) || active.isContentEditable;
}
+ private operators(): OperatorPredicate[] {
+ return this.workflowActionService.getTexeraGraph().getAllOperators();
Review Comment:
Right. Fixed in a007da5b5: the picker iterates the enabled operators only, and the shown results apply the same rule to a viewed step (its eye survives disabling, but the compiled plan leaves the step out). The spec adds a disabled step with the eye and one already picked: neither is offered, and the picked one is not shown.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994265208
##########
frontend/src/app/workspace/service/form-binding/form-binding.service.ts:
##########
@@ -179,17 +179,29 @@ export class FormBindingService {
}
/**
- * Choose whether an operator's output is shown on the form after a run. This records the
- * form's own selection only and never changes the canvas's view-result flags: the form
- * offers exactly the operators the workflow already views, so their results are already
- * materialised and nothing here needs to touch the graph. Read-only, one direction.
+ * Choose whether an intermediate operator's output is featured on the form after a run, on top of
+ * the final steps' results, which show by default. This records the form's own selection only and
+ * never changes the canvas's view-result flags: the picker offers view-result operators, whose
+ * results are already materialised, so nothing here needs to touch the graph. Read-only, one
+ * direction.
*/
public toggleResultOperator(operatorID: string): void {
const shown = this.getConfig().resultOperatorIds;
const next = shown.includes(operatorID) ? shown.filter(id => id !== operatorID) : [...shown, operatorID];
this.updateConfig({ resultOperatorIds: next });
}
+ /**
+ * Turn a final step's result off, or back on. A final step shows by default (the engine always
+ * materialises it), so only the "off" is recorded: a step that becomes final later shows without
+ * being listed anywhere.
+ */
+ public toggleHiddenResult(operatorID: string): void {
Review Comment:
Superseded by the single-list shape in 80640da1a (see the PR comment): with one list there is nothing to keep disjoint, so this method and the cross-list fix are gone.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3993955421
##########
frontend/src/app/workspace/service/form-binding/form-binding.service.ts:
##########
@@ -179,17 +179,29 @@ export class FormBindingService {
}
/**
- * Choose whether an operator's output is shown on the form after a run. This records the
- * form's own selection only and never changes the canvas's view-result flags: the form
- * offers exactly the operators the workflow already views, so their results are already
- * materialised and nothing here needs to touch the graph. Read-only, one direction.
+ * Choose whether an intermediate operator's output is featured on the form after a run, on top of
+ * the final steps' results, which show by default. This records the form's own selection only and
+ * never changes the canvas's view-result flags: the picker offers view-result operators, whose
+ * results are already materialised, so nothing here needs to touch the graph. Read-only, one
+ * direction.
*/
public toggleResultOperator(operatorID: string): void {
const shown = this.getConfig().resultOperatorIds;
const next = shown.includes(operatorID) ? shown.filter(id => id !== operatorID) : [...shown, operatorID];
this.updateConfig({ resultOperatorIds: next });
}
+ /**
+ * Turn a final step's result off, or back on. A final step shows by default (the engine always
+ * materialises it), so only the "off" is recorded: a step that becomes final later shows without
+ * being listed anywhere.
+ */
+ public toggleHiddenResult(operatorID: string): void {
Review Comment:
The two lists are meant to govern disjoint sets (featured intermediates / muted finals), but nothing enforces that, and there is a reachable state where they fight: feature an intermediate step, then delete its downstream on the canvas so it becomes terminal — its id is still in `resultOperatorIds`, so `authorsDefault = (terminals − hidden) + chosen` puts it right back after this records the off, and its pill can never be turned off. Cheapest fix is cross-list hygiene at the sink — this method also drops the id from `resultOperatorIds` (or `authorsDefault` subtracts `hidden` from `chosen` too).
Stepping back, the fight is possible only because two lists govern one display set from opposite directions. A single optional exhaustive list (`shownResultIds?`: undefined = the terminal default, a value = exactly what shows, `[]` = explicitly nothing — which today's shape cannot express) would make this class of conflict unrepresentable, at the cost of new terminals no longer auto-showing once an author has curated — arguably the more predictable behaviour for a curated page. Raising it now while #8517 still has the config shape in flight; the minimal cross-list fix above works if you'd rather keep the shape.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994015702
##########
frontend/src/app/workspace/service/form-binding/form-binding.service.ts:
##########
@@ -179,17 +179,29 @@ export class FormBindingService {
}
/**
- * Choose whether an operator's output is shown on the form after a run. This records the
- * form's own selection only and never changes the canvas's view-result flags: the form
- * offers exactly the operators the workflow already views, so their results are already
- * materialised and nothing here needs to touch the graph. Read-only, one direction.
+ * Choose whether an intermediate operator's output is featured on the form after a run, on top of
+ * the final steps' results, which show by default. This records the form's own selection only and
+ * never changes the canvas's view-result flags: the picker offers view-result operators, whose
+ * results are already materialised, so nothing here needs to touch the graph. Read-only, one
+ * direction.
*/
public toggleResultOperator(operatorID: string): void {
const shown = this.getConfig().resultOperatorIds;
const next = shown.includes(operatorID) ? shown.filter(id => id !== operatorID) : [...shown, operatorID];
this.updateConfig({ resultOperatorIds: next });
}
+ /**
+ * Turn a final step's result off, or back on. A final step shows by default (the engine always
+ * materialises it), so only the "off" is recorded: a step that becomes final later shows without
+ * being listed anywhere.
+ */
+ public toggleHiddenResult(operatorID: string): void {
Review Comment:
Good catch, and the path is real. Fixed in 403bbb534 at the sink, both ways: toggleHiddenResult also drops the id from resultOperatorIds, and toggleResultOperator clears an earlier off entry (the off list is still only created by an explicit off). Spec covers the round trip and the deletion checks for both directions.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3992695185
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -539,14 +570,51 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
return ["TEXTAREA", "SELECT"].includes(active.tagName) || active.isContentEditable;
}
+ private operators(): OperatorPredicate[] {
+ return this.workflowActionService.getTexeraGraph().getAllOperators();
Review Comment:
This includes disabled operators in the picker. Disabled steps are omitted from the execution sub-DAG, so even if they retain `viewResult`, selecting one here can never produce a result for readers. Filter disabled operators here and add the disabled/view-result case to the picker spec.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on PR #8516:
URL: https://github.com/apache/texera/pull/8516#issuecomment-5641775155
Before this merges — the only zero-cost window, since neither field has ever shipped — I'd like to change the two lists into one: `shownResultIds?: string[]`. `undefined` = the terminal default (an untouched form behaves exactly as now); a value = exactly what shows (first curation materialises the current shown set); `[]` = explicitly nothing, which today's shape cannot express. The viewer-local layer is orthogonal and unaffected.
Three reasons. (1) The disjoint invariant now lives only in the two toggle methods, but the config is data: anything else that writes it (a hand edit, a future consumer) can still produce overlapping lists, and the read side still resolves them wrong — `authorsDefault` adds `chosen` back without subtracting `hidden`. With one list the conflict is unrepresentable rather than discouraged. (2) `[]` as "no results section" is a real authoring choice the two-list shape can never store. (3) #8517 and every later consumer learns one concept instead of two opposite-signed ones.
The cost is that a new terminal no longer auto-shows once an author has curated — for a curated page I'd argue that is the more predictable behaviour: a canvas edit should not silently add a card to a page someone laid out. Happy to review it as part of this PR or a follow-up commit on it.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on PR #8516:
URL: https://github.com/apache/texera/pull/8516#issuecomment-5641930204
Done, in this PR: 80640da1a replaces the two lists with `shownResultIds?: string[]` exactly as described. `undefined` = the terminal default, a value = exactly what shows, `[]` = nothing (and the persistence predicate keeps `[]`). `toggleShownResult(id, defaultIds)` materialises the list from the current terminals on the first choice, then flips within it. The viewer-local layer is untouched. Specs: first choice starts from the default, later choices ignore it, `[]` reachable and saved; the component shows terminals until a list exists, then exactly the list. #8517 rebased on top.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3996589016
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1278,18 +1530,66 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* of yourself, broken runs. A fresh document is the reliable handover.
*/
public openRegularCanvas(): void {
- this.save();
- /* v8 ignore start -- full-document navigation; jsdom cannot navigate */
+ // Save first and hand over only once the save has completed: the full-page load unloads this
+ // document, and a request still in flight at that moment is aborted, so navigating right after
+ // firing the save could lose the very edit the switch is meant to carry across. A save that
+ // fails keeps the author here with the error shown, rather than leaving with changes that were
+ // never stored. A reader, who has nothing to save, goes straight over.
+ this.save(() => this.openCanvasPage());
+ }
+
+ /**
+ * The full-page handover to the operator canvas, apart from the save so the order is testable.
+ * Excluded from coverage as a whole: jsdom cannot navigate, so the specs stub this method and
+ * assert when it is called rather than what it does.
+ */
+ /* v8 ignore start */
+ private openCanvasPage(): void {
window.location.href = `${USER_WORKSPACE}/${this.wid}`;
- /* v8 ignore stop */
}
+ /* v8 ignore stop */
/**
* Save the same way the operator canvas does. Both views edit one workflow, so the
* form has to write through the same debounced persist -- otherwise an author's
* setup, or a value someone filled in, would be gone on the next visit.
+ *
+ * Saves go out one at a time, in order (persistQueue). Two persists in flight at once can reach
+ * the backend out of order, and then the older content wins; with the queue, the save behind the
+ * Canvas switch is sent only after an autosave already on its way has completed, and the last
+ * one enqueued carries the latest content. The drain is deliberately NOT tied to this component's
+ * lifetime: the final save on the way out (ngOnDestroy) has to line up behind an autosave still in
+ * flight too, or the older snapshot could commit after it. ngOnDestroy completes the queue, so the
+ * drain ends by itself once the last save has gone out; every request is a one-shot HTTP call.
*/
private registerAutoPersist(): void {
+ this.persistQueue
+ .pipe(
+ concatMap(workflow =>
+ this.persistNow(workflow).pipe(
+ // A failed save has reported itself; it must not let anyone navigate away from changes
+ // that were never stored, so whatever was waiting for the drain is dropped.
+ tap({ error: () => (this.afterDrain = []) }),
+ // A failed save must not take the queue down with it: the next one still goes out.
+ catchError(() => EMPTY),
+ // Complete or failed, this save is done. Once nothing is left in the queue, run what was
+ // waiting for the drain: by then every save asked for so far, this one and any enqueued
+ // behind it while it was in flight, has gone out and come back.
+ finalize(() => {
+ this.queuedSaves--;
+ if (this.queuedSaves === 0) {
+ const waiting = this.afterDrain;
+ this.afterDrain = [];
+ waiting.forEach(run => run());
Review Comment:
Right — the queue only counts enqueued saves, so an edit still sitting in the autosave debounce when the drain reached zero was lost to the full-page load. Fixed in d5bf9af59: workflowChanged marks the page dirty before the debounce, an enqueued snapshot clears the mark, and the drain flushes one more save instead of handing over while the mark is set. Spec: an edit made after the switch click, still in the debounce, goes out before navigation; disabling the flush turns it red.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8516:
URL: https://github.com/apache/texera/pull/8516#issuecomment-5638901316
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- **Contributors with relevant context:** `@PG1204`, `@Yicong-Huang`, `@mengw15`
You can notify them by mentioning `@PG1204`, `@Yicong-Huang`, `@mengw15` in a comment.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3995153730
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -983,6 +1137,78 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
this.instructionOpen = !this.instructionOpen;
}
+ // ---------------------------------------------------------------------------
+ // Author mode: editing the form in place (write access only). Graph edits go through the same
+ // shared graph the operator canvas edits; form-binding edits go through the form-binding config
+ // (local until #8351 shares it). Each edit then re-reads the config.
+ // ---------------------------------------------------------------------------
+
+ public toggleAuthoring(): void {
+ // Entering edit mode needs write access. The Edit button is only rendered for a writer, but the
+ // guard belongs here, at the method, so no other caller can put a reader into a mode whose every
+ // action writes the shared config. Leaving edit mode is always allowed.
+ if (!this.authoring && !this.canEdit) {
+ return;
+ }
+ this.authoring = !this.authoring;
+ if (this.authoring) {
+ // An author picks fields off the workflow, so show it.
+ this.showWorkflow();
+ // In edit mode the picker sets the default for everyone, so the author's own view of the
+ // results (if they toggled any as a viewer) gives way to that default.
+ this.viewerResultIds = undefined;
+ } else {
+ this.workflowOpen = false;
+ }
Review Comment:
Leaving authoring keeps the selected operator mounted, but changing `actsAsEditor` to false only remounts the property frame; neither that remount nor the frame's teardown clears the `currentlyEditing` awareness value it published in editor mode (`property-editor.component.ts:152-156`, `operator-property-edit-frame.component.ts:649-653,619-622`). Co-editors can therefore keep seeing this Form View session as editing the operator after Done. Clear the awareness entry when leaving authoring (or close/unhighlight the selected panel).
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -237,32 +343,36 @@ <h2>{{ instructionTitle || "How to use this" }}</h2>
aria-hidden="true"></i>
</button>
- <!-- A reader can open a step to view its settings, read-only. Read-only is enforced twice,
- at different layers, because neither layer alone is enough:
- [actsAsEditor]="false" stops every write the panel can make (co-editor
- awareness, operator version, operator properties) -- that is the one that matters, since
- merely opening a step makes ajv fill in schema defaults and emit a change; and `inert`
- stops the interaction, blocking pointer, keyboard and focus. Disabling the form is not a
- substitute for `inert`: the preset save/apply/delete buttons, the array add/remove
- buttons and the drag-to-reorder handles are plain controls that a disabled FormGroup
- does not reach. Turning the panel live for choosing what to expose is the authoring PR.
- The panel is the scroll container and takes the focus itself (tabindex, aria-label), so
- a keyboard reader can still scroll a long panel that `inert` content cannot hold focus in.
+ <!-- Reader / inspect: read-only is enforced twice, at different layers, because neither
+ layer alone is enough. [actsAsEditor]="false" stops every write the panel can make
+ (co-editor awareness, operator version, operator properties) -- that is the one that
+ matters, since merely opening a step makes ajv fill in schema defaults and emit a
+ change; and `inert` stops the interaction, blocking pointer, keyboard and focus.
+ Disabling the form is not a substitute for `inert`: the preset save/apply/delete
+ buttons, the array add/remove buttons and the drag-to-reorder handles are plain
+ controls that a disabled FormGroup does not reach. Since `inert` content cannot hold
+ focus, the panel takes the tab stop itself so a keyboard reader can still scroll a long
+ panel.
+ Authoring: the panel goes live -- inert off, acting as an editor, exposeChoosing on
+ (tick boxes to pick what the form exposes), so it edits like the canvas, which edit mode
+ has already enabled workflow modification for. The panel's own tab stop goes away with
+ inert, so it does not sit in front of the form it now contains. persistPlacement stays
+ off either way (this is not the docked canvas panel).
[hidden], not *ngIf: the property editor shows its operator by REACTING to the highlight
stream (no initial pull), so it must already be mounted and subscribed when the click
highlights a step. Mounting it on selection (*ngIf) subscribes too late, misses that
emission, and the panel opens empty. So keep it mounted and just hide it. -->
<div
class="panel"
role="group"
- tabindex="0"
- aria-label="Step settings, read-only"
+ [attr.tabindex]="authoring ? null : 0"
+ [attr.aria-label]="authoring ? 'Step settings' : 'Step settings, read-only'"
[hidden]="!selectedOperatorId">
<texera-property-editor
- [exposeChoosing]="false"
+ [exposeChoosing]="authoring"
[persistPlacement]="false"
- [actsAsEditor]="false"
- [attr.inert]="''"></texera-property-editor>
+ [actsAsEditor]="authoring"
Review Comment:
Entering Edit during an active run still remounts a selected property frame with `actsAsEditor=true`, even though `mayUnlock()` keeps the root lock off. That frame does not consult the lock before editor-only writes: it synchronizes the operator version on mount and its AJV-default form event writes whenever `actsAsEditor` is true (`operator-property-edit-frame.component.ts:649-660, 715-727, 813-824`). A selected step can therefore mutate the running workflow merely by entering Edit. Gate editor mode on the execution state as well.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994426632
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +545,41 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked by the execute service once it ends.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
+ this.workflowActionService.disableWorkflowModification();
Review Comment:
Confirmed against updateExecutionState (lock first, state second). 3660475dc re-applies the editability rule in the execution-state handler once the state has settled, so edit mode gets the unlock back; the clamp stays for the other unlockers. The three specs now emit the unlock before the state, and a deletion check on the re-application turns two of them red.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1301,40 +1526,56 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* workflow when the payload has no id, so saving whatever the graph holds would spawn
* stray "Untitled workflow" rows when the page is left before its workflow loaded.
*/
- private save(): void {
+ private save(afterwards?: () => void): void {
// A read-only viewer can open and run the form (execution is gated on computing-unit access,
// not workflow access) but must never persist: every such save is a guaranteed 403 that would
// spam "Could not save" on each debounce. Their inputs are non-editable, so nothing is lost.
+ // `afterwards` runs once the save has completed, or at once when there is nothing to save;
+ // it does not run when the save fails, so a caller that navigates on it stays put instead.
if (!this.canEdit) {
+ afterwards?.();
return;
}
if (!this.userService.isLogin() || !this.workflowPersistService.isWorkflowPersistEnabled()) {
+ afterwards?.();
return;
}
const workflow = this.workflowActionService.getWorkflow();
if (workflow.wid === undefined || workflow.wid !== this.wid) {
+ afterwards?.();
return;
}
+ if (this.destroyed) {
+ // On the way out there is no page left to queue on, and the request must NOT be tied to this
+ // component: ngOnDestroy calls save(), and untilDestroyed would tear the subscription down as
+ // part of the very same destroy sequence, aborting the request that was the point of the
+ // call. The persist is a one-shot HTTP request that completes on its own, so it needs no
+ // teardown operator; the error is reported inside persistNow.
+ // eslint-disable-next-line rxjs-angular/prefer-takeuntil
+ this.persistNow().subscribe({ error: () => undefined });
Review Comment:
Agreed. 3660475dc drops the direct destroy-time persist: the queue's drain is no longer tied to the component, the final save joins it behind whatever is in flight, and ngOnDestroy completes the queue so the drain ends by itself. Each request carries the snapshot taken when the save was asked for (ngOnDestroy clears the graph right after enqueueing, so a send-time snapshot would have been empty). Spec: the final save waits for an in-flight autosave and goes out after it.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +545,41 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked by the execute service once it ends.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
Review Comment:
Yes, exactly that, and the spec ordering too. 3660475dc: applyEditability() runs in the execution-state subscription after this.executionState = current.state, the clamp stays for the computing-unit selector and any other unlocker, and the specs emit the unlock before the state as the service does. Deleting the re-application turns the mid-run and the run-ended specs red.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994460105
##########
frontend/src/app/common/type/workflow.ts:
##########
@@ -67,13 +67,16 @@ export interface FormBindingConfig {
};
/** Array order is display order; the author reorders by dragging. */
fields: FormFieldBinding[];
- /** View-result operators whose results are also shown under the workflow after a run, on top of
- * the final step's result, which always shows. */
- resultOperatorIds: string[];
+ /** Which steps' results show under the workflow after a run, for everyone. Absent until the author
+ * chooses: then every final (terminal) step shows, as on the canvas. Once set it is exhaustive:
+ * exactly these steps show, and [] means none. One list, so nothing can contradict it; the cost is
+ * that a step which becomes final after the author has chosen does not appear by itself. When
+ * displayed it is kept to steps that still have a result on the canvas. */
+ shownResultIds?: string[];
Review Comment:
No persisted workflow carries either field, so there is nothing to migrate: `form-view-enabled = false` on main (gui.conf:89), the Form View page is the only writer of `formBinding` (setFormBinding is reached only through FormBindingService there; hydrateFormBinding and getWorkflowContent re-emit what was loaded, and the backend only carries the content through), and that page redirects to the canvas while the flag is off. That is the zero-cost window mengw15 pointed at in the PR comment, which is why this is a rename rather than a migration; #8456 is what turns the flag on. A stale key in a developer database is ignored and the form falls back to the terminal default. Leaving this open in case I have missed a writer.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3996539836
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1278,18 +1530,66 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* of yourself, broken runs. A fresh document is the reliable handover.
*/
public openRegularCanvas(): void {
- this.save();
- /* v8 ignore start -- full-document navigation; jsdom cannot navigate */
+ // Save first and hand over only once the save has completed: the full-page load unloads this
+ // document, and a request still in flight at that moment is aborted, so navigating right after
+ // firing the save could lose the very edit the switch is meant to carry across. A save that
+ // fails keeps the author here with the error shown, rather than leaving with changes that were
+ // never stored. A reader, who has nothing to save, goes straight over.
+ this.save(() => this.openCanvasPage());
+ }
+
+ /**
+ * The full-page handover to the operator canvas, apart from the save so the order is testable.
+ * Excluded from coverage as a whole: jsdom cannot navigate, so the specs stub this method and
+ * assert when it is called rather than what it does.
+ */
+ /* v8 ignore start */
+ private openCanvasPage(): void {
window.location.href = `${USER_WORKSPACE}/${this.wid}`;
- /* v8 ignore stop */
}
+ /* v8 ignore stop */
/**
* Save the same way the operator canvas does. Both views edit one workflow, so the
* form has to write through the same debounced persist -- otherwise an author's
* setup, or a value someone filled in, would be gone on the next visit.
+ *
+ * Saves go out one at a time, in order (persistQueue). Two persists in flight at once can reach
+ * the backend out of order, and then the older content wins; with the queue, the save behind the
+ * Canvas switch is sent only after an autosave already on its way has completed, and the last
+ * one enqueued carries the latest content. The drain is deliberately NOT tied to this component's
+ * lifetime: the final save on the way out (ngOnDestroy) has to line up behind an autosave still in
+ * flight too, or the older snapshot could commit after it. ngOnDestroy completes the queue, so the
+ * drain ends by itself once the last save has gone out; every request is a one-shot HTTP call.
*/
private registerAutoPersist(): void {
+ this.persistQueue
+ .pipe(
+ concatMap(workflow =>
+ this.persistNow(workflow).pipe(
+ // A failed save has reported itself; it must not let anyone navigate away from changes
+ // that were never stored, so whatever was waiting for the drain is dropped.
+ tap({ error: () => (this.afterDrain = []) }),
+ // A failed save must not take the queue down with it: the next one still goes out.
+ catchError(() => EMPTY),
+ // Complete or failed, this save is done. Once nothing is left in the queue, run what was
+ // waiting for the drain: by then every save asked for so far, this one and any enqueued
+ // behind it while it was in flight, has gone out and come back.
+ finalize(() => {
+ this.queuedSaves--;
+ if (this.queuedSaves === 0) {
+ const waiting = this.afterDrain;
+ this.afterDrain = [];
+ waiting.forEach(run => run());
Review Comment:
The drain can navigate while a newer edit is still waiting in the 5-second `workflowChanged()` debounce. If the user edits after clicking Canvas and the switch save completes before that debounce fires, `queuedSaves` reaches zero here, the full-page load cancels the pending autosave, and the post-click edit was not in the switch snapshot. Track dirty changes immediately and enqueue/flush the latest snapshot before running `afterDrain` (or make the page non-editable as soon as handover starts).
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3995284489
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -237,32 +343,36 @@ <h2>{{ instructionTitle || "How to use this" }}</h2>
aria-hidden="true"></i>
</button>
- <!-- A reader can open a step to view its settings, read-only. Read-only is enforced twice,
- at different layers, because neither layer alone is enough:
- [actsAsEditor]="false" stops every write the panel can make (co-editor
- awareness, operator version, operator properties) -- that is the one that matters, since
- merely opening a step makes ajv fill in schema defaults and emit a change; and `inert`
- stops the interaction, blocking pointer, keyboard and focus. Disabling the form is not a
- substitute for `inert`: the preset save/apply/delete buttons, the array add/remove
- buttons and the drag-to-reorder handles are plain controls that a disabled FormGroup
- does not reach. Turning the panel live for choosing what to expose is the authoring PR.
- The panel is the scroll container and takes the focus itself (tabindex, aria-label), so
- a keyboard reader can still scroll a long panel that `inert` content cannot hold focus in.
+ <!-- Reader / inspect: read-only is enforced twice, at different layers, because neither
+ layer alone is enough. [actsAsEditor]="false" stops every write the panel can make
+ (co-editor awareness, operator version, operator properties) -- that is the one that
+ matters, since merely opening a step makes ajv fill in schema defaults and emit a
+ change; and `inert` stops the interaction, blocking pointer, keyboard and focus.
+ Disabling the form is not a substitute for `inert`: the preset save/apply/delete
+ buttons, the array add/remove buttons and the drag-to-reorder handles are plain
+ controls that a disabled FormGroup does not reach. Since `inert` content cannot hold
+ focus, the panel takes the tab stop itself so a keyboard reader can still scroll a long
+ panel.
+ Authoring: the panel goes live -- inert off, acting as an editor, exposeChoosing on
+ (tick boxes to pick what the form exposes), so it edits like the canvas, which edit mode
+ has already enabled workflow modification for. The panel's own tab stop goes away with
+ inert, so it does not sit in front of the form it now contains. persistPlacement stays
+ off either way (this is not the docked canvas panel).
[hidden], not *ngIf: the property editor shows its operator by REACTING to the highlight
stream (no initial pull), so it must already be mounted and subscribed when the click
highlights a step. Mounting it on selection (*ngIf) subscribes too late, misses that
emission, and the panel opens empty. So keep it mounted and just hide it. -->
<div
class="panel"
role="group"
- tabindex="0"
- aria-label="Step settings, read-only"
+ [attr.tabindex]="authoring ? null : 0"
+ [attr.aria-label]="authoring ? 'Step settings' : 'Step settings, read-only'"
[hidden]="!selectedOperatorId">
<texera-property-editor
- [exposeChoosing]="false"
+ [exposeChoosing]="authoring"
[persistPlacement]="false"
- [actsAsEditor]="false"
- [attr.inert]="''"></texera-property-editor>
+ [actsAsEditor]="authoring"
Review Comment:
Confirmed: the frame syncs the version on mount and writes ajv defaults whenever actsAsEditor is true, without consulting the lock. c66787a73 binds the panel's actsAsEditor / exposeChoosing / inert to the lock's own rule (panelLive: edit mode, write access, no run in flight), so a step selected mid-run mounts read-only even in edit mode and turns live when the run ends. Rendered spec covers both states; binding it to authoring alone turns it red. The suppressed hand-over note is addressed too: navigation now waits for the queue to drain (a save queued behind the switch's, and its failure keeping the page), with specs for both.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -983,6 +1137,78 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
this.instructionOpen = !this.instructionOpen;
}
+ // ---------------------------------------------------------------------------
+ // Author mode: editing the form in place (write access only). Graph edits go through the same
+ // shared graph the operator canvas edits; form-binding edits go through the form-binding config
+ // (local until #8351 shares it). Each edit then re-reads the config.
+ // ---------------------------------------------------------------------------
+
+ public toggleAuthoring(): void {
+ // Entering edit mode needs write access. The Edit button is only rendered for a writer, but the
+ // guard belongs here, at the method, so no other caller can put a reader into a mode whose every
+ // action writes the shared config. Leaving edit mode is always allowed.
+ if (!this.authoring && !this.canEdit) {
+ return;
+ }
+ this.authoring = !this.authoring;
+ if (this.authoring) {
+ // An author picks fields off the workflow, so show it.
+ this.showWorkflow();
+ // In edit mode the picker sets the default for everyone, so the author's own view of the
+ // results (if they toggled any as a viewer) gives way to that default.
+ this.viewerResultIds = undefined;
+ } else {
+ this.workflowOpen = false;
+ }
Review Comment:
Right, the viewer remount clears nothing and the property editor clears currentlyEditing only while it acts as an editor. c66787a73 makes Done dismiss the step panel (closeOperatorPanel, through the action service) before authoring flips off, so the clear runs while the frame is still an editor. Spec asserts the dismissal happens with authoring still true; deleting it turns the spec red.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994144070
##########
frontend/src/app/common/type/workflow.ts:
##########
@@ -68,8 +68,13 @@ export interface FormBindingConfig {
/** Array order is display order; the author reorders by dragging. */
fields: FormFieldBinding[];
/** View-result operators whose results are also shown under the workflow after a run, on top of
- * the final step's result, which always shows. */
+ * the final steps' results, which show by default. */
resultOperatorIds: string[];
+ /** Final (terminal) steps whose result the author turned off. A final step shows by default, so a
+ * step that becomes final later shows without being listed anywhere; only an explicit "off" is
+ * stored. Absent until the author turns one off (and on every config written before the field
+ * existed), which means none turned off. */
+ hiddenResultOperatorIds?: string[];
Review Comment:
This new field is not included in `WorkflowActionService.isFormBindingNonEmpty` (`workflow-action.service.ts:773-774`). For a workflow that never had `formBinding`, turning off a final result can leave `fields`, `resultOperatorIds`, and `instruction` empty, so `getWorkflowContent()` omits the entire config and the hidden result is lost on save/reload. Include a non-empty `hiddenResultOperatorIds` in that persistence predicate and cover the hidden-only round trip.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -539,39 +577,91 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
return ["TEXTAREA", "SELECT"].includes(active.tagName) || active.isContentEditable;
}
+ /**
+ * The steps a result can come from. The engine compiles only the enabled operators, so a disabled
+ * step produces nothing however it is flagged: not offered in the picker, not shown as a result.
+ */
+ private enabledOperators(): OperatorPredicate[] {
+ return this.workflowActionService
+ .getTexeraGraph()
+ .getAllOperators()
+ .filter(op => !(op.isDisabled ?? false));
+ }
+
+ /**
+ * The picker's candidates: every final step (on by default, the engine always materialises it) and
+ * every intermediate step with view-result ("the eye") on the canvas, plus any already-chosen step so
+ * a pick never vanishes from its own picker. Reuse the one terminal rule (terminalOperatorIds) rather
+ * than a second copy. Disabled steps are not offered at all, chosen or not: they are left out of the
+ * run, so featuring one could never show anyone anything. The shown flag mirrors shownResultIds, so
+ * it reflects the viewer's own choice when they have made one and the author's default otherwise.
+ */
+ private rebuildResultChoices(): void {
+ const config = this.formBindingService.getConfig();
+ const viewed = this.workflowActionService.getTexeraGraph().getOperatorsToViewResult();
+ const chosen = new Set(config.resultOperatorIds);
+ const terminals = new Set(this.terminalOperatorIds());
+ const shown = new Set(this.shownResultIds);
+ this.resultChoices = this.enabledOperators()
+ .filter(op => terminals.has(op.operatorID) || viewed.has(op.operatorID) || chosen.has(op.operatorID))
Review Comment:
A reader is also given saved `resultOperatorIds` whose canvas eye has since been turned off. Such a choice is always `shown: false`, and clicking it cannot turn it on: `onToggleResult` adds the ID, but `refreshShownResults` immediately filters it out because no result is materialized. Keep stale saved choices only in authoring mode, where the author can remove them; readers should see only terminal or currently viewed operators.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +541,18 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Lock or unlock editing: the graph and its properties are read-only unless a writer is in edit
+ * mode, which is the only state that unlocks them (see toggleAuthoring).
*/
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ // Edit mode with write access is the only state that makes the operator properties (and the
+ // embedded canvas) modifiable here; every other state locks them, so a reader -- or a writer
+ // just viewing -- cannot change the workflow through this page.
+ if (this.authoring && this.canEdit) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
Review Comment:
This does not remain the only enablement path: `ExecuteWorkflowService.updateWorkflowActionLock()` calls `enableWorkflowModification()` whenever a run completes, fails, is killed, or is reset (`execute-workflow.service.ts:385-400`). For a writable workflow viewed outside authoring mode, finishing a Form View run therefore flips the global flag back on; the locked preview then exposes the context-menu view-result command (which intentionally is not gated by `structureLocked`) and that command mutates/autosaves the shared graph. Reapply the Form View's authoring lock after terminal execution-state transitions so a writer merely viewing still cannot modify the workflow.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3995169678
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1301,40 +1545,47 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* workflow when the payload has no id, so saving whatever the graph holds would spawn
* stray "Untitled workflow" rows when the page is left before its workflow loaded.
*/
- private save(): void {
+ private save(afterwards?: () => void): void {
// A read-only viewer can open and run the form (execution is gated on computing-unit access,
// not workflow access) but must never persist: every such save is a guaranteed 403 that would
// spam "Could not save" on each debounce. Their inputs are non-editable, so nothing is lost.
+ // `afterwards` runs once the save has completed, or at once when there is nothing to save;
+ // it does not run when the save fails, so a caller that navigates on it stays put instead.
if (!this.canEdit) {
+ afterwards?.();
return;
}
if (!this.userService.isLogin() || !this.workflowPersistService.isWorkflowPersistEnabled()) {
+ afterwards?.();
return;
}
const workflow = this.workflowActionService.getWorkflow();
if (workflow.wid === undefined || workflow.wid !== this.wid) {
+ afterwards?.();
return;
}
+ // Snapshot now, not when the request's turn comes: on the way out ngOnDestroy clears the graph
+ // right after asking for this save, and the queue may only reach it after that.
const preserved: Workflow = {
...workflow,
content: { ...workflow.content, operatorPositions: this.positionsToSave(workflow.content) },
};
- // On the way out the subscription must NOT be tied to this component: ngOnDestroy
- // calls save(), and untilDestroyed would tear the subscription down as part of the
- // very same destroy sequence, aborting the request that was the point of the call.
- const persist = this.workflowPersistService.persistWorkflow(preserved);
- // The `destroyed` branch deliberately omits untilDestroyed (see above); the persist call
- // is a one-shot HTTP request that completes on its own, so it needs no teardown operator.
- // eslint-disable-next-line rxjs-angular/prefer-takeuntil
- (this.destroyed ? persist : persist.pipe(untilDestroyed(this))).subscribe({
- // Feed the saved workflow back, exactly as the operator canvas does: this advances
- // lastModifiedTime (and the normalised name), and the metadata subscription then repaints
- // the title bar -- so "Saved at ..." moves past the moment the page opened.
- next: updatedWorkflow => this.workflowActionService.setWorkflowMetadata(updatedWorkflow),
- // A save that fails silently is the worst thing this page can do: the author walks
- // away believing the form they just built is stored.
- error: () => this.notificationService.error("Could not save. Your latest changes are not stored yet."),
- });
+ this.persistQueue.next({ workflow: preserved, afterwards });
+ }
+
+ /** One persist of the given snapshot, reporting its outcome; the queue orders them. */
+ private persistNow(preserved: Workflow): Observable<Workflow> {
+ return this.workflowPersistService.persistWorkflow(preserved).pipe(
+ tap({
+ // Feed the saved workflow back, exactly as the operator canvas does: this advances
+ // lastModifiedTime (and the normalised name), and the metadata subscription then repaints
+ // the title bar -- so "Saved at ..." moves past the moment the page opened.
+ next: updatedWorkflow => this.workflowActionService.setWorkflowMetadata(updatedWorkflow),
Review Comment:
Right on both counts. c77e15748: the response feeds back the server-owned metadata (the timestamp, and the normalised name when nothing changed), but if the name differs from the snapshot that was sent (a rename since, whose own save is already queued) the current name is kept; and once the page is gone nothing is fed back, so the cleared singleton is not refilled. Specs: an older save's response does not undo a rename made meanwhile; no metadata repaint after destroy. Deleting either guard turns its spec red.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -316,7 +346,11 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
.getViewResultOperatorsChangedStream()
.pipe(untilDestroyed(this))
.subscribe(() => {
+ // An eye toggled on the canvas changes both what shows (a newly-viewed step) and what the
+ // author can pick, so rebuild the picker here too -- otherwise a just-eyed step would not
+ // appear as an option (and an un-eyed one would linger) until the next full re-read.
this.refreshShownResults();
+ this.rebuildResultChoices();
Review Comment:
Agreed. Compilation does re-read the config after those edits (it merges the same add/delete/link/disabled streams), but debounced and held while the reader is typing, so the card and the pill could lag. c77e15748 subscribes to the graph's operator add/delete, link add/delete and disabled-changed streams directly and refreshes the two derived collections at once (nothing rebuilds the inputs). Spec: a shown final step disabled by a co-editor drops from the cards and the picker on that event alone; deleting the subscription turns it red.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3992294402
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -336,5 +445,30 @@ <h2>{{ instructionTitle || "How to use this" }}</h2>
</div>
</ng-container>
</section>
+
+ <!-- Author picks which earlier steps also report back; the final result always shows. Toggling a
+ pill writes the chosen set; a reader never sees this section. -->
+ <section
+ class="card respick"
+ *ngIf="authoring">
+ <h3>Results shown here</h3>
+ <p>The final result always shows. Toggle an earlier step here to feature its result too.</p>
+ <div class="opts">
+ <button
+ type="button"
+ class="pill"
+ *ngFor="let choice of resultChoices"
+ [class.on]="choice.shown"
+ [attr.aria-pressed]="choice.shown"
+ (click)="onToggleResult(choice)">
Review Comment:
A result toggle emits `formBindingChanged$`, which synchronously rebuilds `resultChoices` with new objects. With identity tracking, Angular destroys the pressed button, so keyboard focus is lost after every toggle. Track these rows by `operatorID` (and avoid the redundant explicit `readConfig()` rebuild) to preserve focus.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -61,6 +61,30 @@
</div>
<div class="pc-page">
+ <!-- Only a writer sees Edit, which flips the whole page into in-place authoring; the lede appears
+ only while authoring, to say what edit mode is for. -->
+ <header
+ class="pc-head"
+ *ngIf="canEdit">
Review Comment:
This visible Form View UI change still has only “to be added” in the PR’s Screenshot section. Repository guidance requires before/after screenshots or a GIF side by side for frontend UI changes; please attach them before approval.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -70,48 +94,126 @@
</div>
<div [hidden]="loading">
- <!-- The author's one piece of guidance, shown as rendered markdown, collapsible, and only when
- there is instruction text to show. Editing it is part of the authoring PR. -->
+ <!-- The author's one piece of guidance, shown as rendered markdown, collapsible. A reader sees
+ it only when there is text; an author always sees the section, to write it (write/preview). -->
<section
class="card instr"
- *ngIf="hasInstruction"
+ *ngIf="hasInstruction || authoring"
[class.open]="instructionOpen">
- <button
- type="button"
+ <!-- The header is a row, not one big button, because while authoring it holds the title INPUT,
+ and an input inside a button is invalid interactive nesting (assistive tech gets two
+ controls fighting over one click). Reading: the whole row is the toggle. Authoring: the
+ row is icon, title input, and a chevron button that toggles, so the input is the control's
+ sibling rather than its child. Either toggle names the body it opens (aria-controls). -->
+ <div
class="instr-bar"
- [attr.aria-expanded]="instructionOpen"
- (click)="toggleInstruction()">
- <i
- nz-icon
- nzType="info-circle"
- class="lead"
- aria-hidden="true"></i>
- <h2>{{ instructionTitle || "How to use this" }}</h2>
- <i
- nz-icon
- nzType="down"
- class="chev"
- aria-hidden="true"></i>
- </button>
+ [class.authoring]="authoring">
+ <button
+ *ngIf="!authoring"
+ type="button"
+ class="instr-toggle"
+ [attr.aria-expanded]="instructionOpen"
+ aria-controls="instr-body"
+ (click)="toggleInstruction()">
+ <i
+ nz-icon
+ nzType="info-circle"
+ class="lead"
+ aria-hidden="true"></i>
+ <h2>{{ instructionTitle || "How to use this" }}</h2>
+ <i
+ nz-icon
+ nzType="down"
+ class="chev"
+ aria-hidden="true"></i>
+ </button>
+
+ <ng-container *ngIf="authoring">
+ <i
+ nz-icon
+ nzType="info-circle"
+ class="lead"
+ aria-hidden="true"></i>
+ <!-- An author edits the heading in place here, not in a separate Title box. -->
+ <input
+ class="instr-title-input"
+ [(ngModel)]="instructionTitle"
+ (ngModelChange)="onInstructionChange()"
+ placeholder="How to use this"
+ aria-label="Instruction heading" />
+ <button
+ type="button"
+ class="instr-toggle instr-chev"
+ [attr.aria-expanded]="instructionOpen"
+ aria-controls="instr-body"
+ [attr.aria-label]="instructionOpen ? 'Collapse the instruction' : 'Expand the instruction'"
+ (click)="toggleInstruction()">
+ <i
+ nz-icon
+ nzType="down"
+ class="chev"
+ aria-hidden="true"></i>
+ </button>
+ </ng-container>
+ </div>
<div
+ id="instr-body"
class="instr-body"
[hidden]="!instructionOpen">
<div
class="md"
+ *ngIf="!authoring"
[innerHTML]="instructionPreviewHtml"></div>
+
+ <ng-container *ngIf="authoring">
+ <div class="tabs">
+ <button
+ type="button"
+ [attr.aria-current]="instructionMode === 'write'"
+ (click)="setInstructionMode('write')">
+ Write
+ </button>
+ <button
+ type="button"
+ [attr.aria-current]="instructionMode === 'preview'"
+ (click)="setInstructionMode('preview')">
+ Preview
+ </button>
+ </div>
+
+ <ng-container *ngIf="instructionMode === 'write'">
+ <textarea
+ class="md-input"
+ [(ngModel)]="instructionBody"
+ (ngModelChange)="onInstructionChange()"
+ placeholder="Explain what this does and what to fill in."></textarea>
Review Comment:
The instruction body has no persistent accessible name; its placeholder disappears once text is entered and is not a substitute for a label. Add an accessible label so screen-reader users can identify this textarea while editing.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994499960
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -316,7 +346,11 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
.getViewResultOperatorsChangedStream()
.pipe(untilDestroyed(this))
.subscribe(() => {
+ // An eye toggled on the canvas changes both what shows (a newly-viewed step) and what the
+ // author can pick, so rebuild the picker here too -- otherwise a just-eyed step would not
+ // appear as an option (and an un-eyed one would linger) until the next full re-read.
this.refreshShownResults();
+ this.rebuildResultChoices();
Review Comment:
This updates result availability only when an eye changes, but the new filter also depends on operator existence, enabled state, and terminal topology. Those changes emit separate add/delete/link/disabled streams, so a co-editor can disable a currently shown step (or add a downstream link) and this page keeps the stale result card and picker pill until an unrelated result/config event, contradicting the rule that disabled/unavailable steps are neither offered nor shown. Subscribe to all graph events that can change availability and refresh both derived collections.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1301,40 +1545,47 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* workflow when the payload has no id, so saving whatever the graph holds would spawn
* stray "Untitled workflow" rows when the page is left before its workflow loaded.
*/
- private save(): void {
+ private save(afterwards?: () => void): void {
// A read-only viewer can open and run the form (execution is gated on computing-unit access,
// not workflow access) but must never persist: every such save is a guaranteed 403 that would
// spam "Could not save" on each debounce. Their inputs are non-editable, so nothing is lost.
+ // `afterwards` runs once the save has completed, or at once when there is nothing to save;
+ // it does not run when the save fails, so a caller that navigates on it stays put instead.
if (!this.canEdit) {
+ afterwards?.();
return;
}
if (!this.userService.isLogin() || !this.workflowPersistService.isWorkflowPersistEnabled()) {
+ afterwards?.();
return;
}
const workflow = this.workflowActionService.getWorkflow();
if (workflow.wid === undefined || workflow.wid !== this.wid) {
+ afterwards?.();
return;
}
+ // Snapshot now, not when the request's turn comes: on the way out ngOnDestroy clears the graph
+ // right after asking for this save, and the queue may only reach it after that.
const preserved: Workflow = {
...workflow,
content: { ...workflow.content, operatorPositions: this.positionsToSave(workflow.content) },
};
- // On the way out the subscription must NOT be tied to this component: ngOnDestroy
- // calls save(), and untilDestroyed would tear the subscription down as part of the
- // very same destroy sequence, aborting the request that was the point of the call.
- const persist = this.workflowPersistService.persistWorkflow(preserved);
- // The `destroyed` branch deliberately omits untilDestroyed (see above); the persist call
- // is a one-shot HTTP request that completes on its own, so it needs no teardown operator.
- // eslint-disable-next-line rxjs-angular/prefer-takeuntil
- (this.destroyed ? persist : persist.pipe(untilDestroyed(this))).subscribe({
- // Feed the saved workflow back, exactly as the operator canvas does: this advances
- // lastModifiedTime (and the normalised name), and the metadata subscription then repaints
- // the title bar -- so "Saved at ..." moves past the moment the page opened.
- next: updatedWorkflow => this.workflowActionService.setWorkflowMetadata(updatedWorkflow),
- // A save that fails silently is the worst thing this page can do: the author walks
- // away believing the form they just built is stored.
- error: () => this.notificationService.error("Could not save. Your latest changes are not stored yet."),
- });
+ this.persistQueue.next({ workflow: preserved, afterwards });
+ }
+
+ /** One persist of the given snapshot, reporting its outcome; the queue orders them. */
+ private persistNow(preserved: Workflow): Observable<Workflow> {
+ return this.workflowPersistService.persistWorkflow(preserved).pipe(
+ tap({
+ // Feed the saved workflow back, exactly as the operator canvas does: this advances
+ // lastModifiedTime (and the normalised name), and the metadata subscription then repaints
+ // the title bar -- so "Saved at ..." moves past the moment the page opened.
+ next: updatedWorkflow => this.workflowActionService.setWorkflowMetadata(updatedWorkflow),
Review Comment:
Applying every queued response unconditionally can overwrite newer local metadata. For example, while save A is in flight, rename to B and enqueue save B; when A completes, this resets the shared metadata (and, after the 100 ms metadata subscription, the title) to A until B returns, and another autosave in that window can snapshot A as the newest value. The drain can also run this after teardown and repopulate the singleton after `clearWorkflow()`. Guard the response against the request snapshot/current workflow, and skip metadata feedback after destruction, while still merging server-owned save metadata such as the timestamp.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994206748
##########
frontend/src/app/common/type/workflow.ts:
##########
@@ -68,8 +68,13 @@ export interface FormBindingConfig {
/** Array order is display order; the author reorders by dragging. */
fields: FormFieldBinding[];
/** View-result operators whose results are also shown under the workflow after a run, on top of
- * the final step's result, which always shows. */
+ * the final steps' results, which show by default. */
resultOperatorIds: string[];
+ /** Final (terminal) steps whose result the author turned off. A final step shows by default, so a
+ * step that becomes final later shows without being listed anywhere; only an explicit "off" is
+ * stored. Absent until the author turns one off (and on every config written before the field
+ * existed), which means none turned off. */
+ hiddenResultOperatorIds?: string[];
Review Comment:
Right. b534b69db: isFormBindingNonEmpty now counts a non-empty hiddenResultOperatorIds, with a spec for the off-only definition surviving getWorkflowContent().
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +541,18 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Lock or unlock editing: the graph and its properties are read-only unless a writer is in edit
+ * mode, which is the only state that unlocks them (see toggleAuthoring).
*/
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ // Edit mode with write access is the only state that makes the operator properties (and the
+ // embedded canvas) modifiable here; every other state locks them, so a reader -- or a writer
+ // just viewing -- cannot change the workflow through this page.
+ if (this.authoring && this.canEdit) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
Review Comment:
Confirmed: updateWorkflowActionLock re-enables on Completed/Failed/Killed/Uninitialized regardless of this page's mode. b534b69db re-locks in the execution-state subscription whenever the page is not in edit mode (a writer in edit mode keeps the canvas rule: locked while running, unlocked after). Specs cover both.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -539,39 +577,91 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
return ["TEXTAREA", "SELECT"].includes(active.tagName) || active.isContentEditable;
}
+ /**
+ * The steps a result can come from. The engine compiles only the enabled operators, so a disabled
+ * step produces nothing however it is flagged: not offered in the picker, not shown as a result.
+ */
+ private enabledOperators(): OperatorPredicate[] {
+ return this.workflowActionService
+ .getTexeraGraph()
+ .getAllOperators()
+ .filter(op => !(op.isDisabled ?? false));
+ }
+
+ /**
+ * The picker's candidates: every final step (on by default, the engine always materialises it) and
+ * every intermediate step with view-result ("the eye") on the canvas, plus any already-chosen step so
+ * a pick never vanishes from its own picker. Reuse the one terminal rule (terminalOperatorIds) rather
+ * than a second copy. Disabled steps are not offered at all, chosen or not: they are left out of the
+ * run, so featuring one could never show anyone anything. The shown flag mirrors shownResultIds, so
+ * it reflects the viewer's own choice when they have made one and the author's default otherwise.
+ */
+ private rebuildResultChoices(): void {
+ const config = this.formBindingService.getConfig();
+ const viewed = this.workflowActionService.getTexeraGraph().getOperatorsToViewResult();
+ const chosen = new Set(config.resultOperatorIds);
+ const terminals = new Set(this.terminalOperatorIds());
+ const shown = new Set(this.shownResultIds);
+ this.resultChoices = this.enabledOperators()
+ .filter(op => terminals.has(op.operatorID) || viewed.has(op.operatorID) || chosen.has(op.operatorID))
Review Comment:
Agreed. b534b69db keeps saved picks in the candidate list only in edit mode (so the author can un-pick a stale one); a reader sees final steps and currently viewed steps only. Spec: a reader is not offered a saved pick whose eye is off.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994462288
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +551,43 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked once it ends -- the execute service flips the lock
+ * before it emits the new state, so that unlock is clamped here (this page still sees "running")
+ * and given back by the execution-state handler, which re-applies the rule with the new state.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
+ this.workflowActionService.disableWorkflowModification();
Review Comment:
Confirmed, and it is reachable through the undo path: the editor binds ctrl+z on a document-level keydown with no `interactive` gate, so the only thing stopping an undo on this page is `UndoRedoService.workFlowModificationEnabled` — and the outer `enableWorkflowModification()` re-enables it after the clamp's nested disable (`undoRedoService.enableWorkFlowModification()` runs after the emission). So: edit a property in edit mode, Done, run, run ends — ctrl+z then replays that edit onto the shared graph from a page in view mode.
One correction to the comment above: the result toggle stays safe — OperatorMenuService recomputes from `checkWorkflowModificationEnabled()` (the flag, already false by then), not from the event payload.
Deferring the clamp's disable by one microtask (e.g. `observeOn(asapScheduler)`) would let the enable call finish first; the disable then runs as a clean top-level call and every consumer, the undo/redo flag included, converges on locked.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3992515665
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -70,48 +94,126 @@
</div>
<div [hidden]="loading">
- <!-- The author's one piece of guidance, shown as rendered markdown, collapsible, and only when
- there is instruction text to show. Editing it is part of the authoring PR. -->
+ <!-- The author's one piece of guidance, shown as rendered markdown, collapsible. A reader sees
+ it only when there is text; an author always sees the section, to write it (write/preview). -->
<section
class="card instr"
- *ngIf="hasInstruction"
+ *ngIf="hasInstruction || authoring"
[class.open]="instructionOpen">
- <button
- type="button"
+ <!-- The header is a row, not one big button, because while authoring it holds the title INPUT,
+ and an input inside a button is invalid interactive nesting (assistive tech gets two
+ controls fighting over one click). Reading: the whole row is the toggle. Authoring: the
+ row is icon, title input, and a chevron button that toggles, so the input is the control's
+ sibling rather than its child. Either toggle names the body it opens (aria-controls). -->
+ <div
class="instr-bar"
- [attr.aria-expanded]="instructionOpen"
- (click)="toggleInstruction()">
- <i
- nz-icon
- nzType="info-circle"
- class="lead"
- aria-hidden="true"></i>
- <h2>{{ instructionTitle || "How to use this" }}</h2>
- <i
- nz-icon
- nzType="down"
- class="chev"
- aria-hidden="true"></i>
- </button>
+ [class.authoring]="authoring">
+ <button
+ *ngIf="!authoring"
+ type="button"
+ class="instr-toggle"
+ [attr.aria-expanded]="instructionOpen"
+ aria-controls="instr-body"
+ (click)="toggleInstruction()">
+ <i
+ nz-icon
+ nzType="info-circle"
+ class="lead"
+ aria-hidden="true"></i>
+ <h2>{{ instructionTitle || "How to use this" }}</h2>
+ <i
+ nz-icon
+ nzType="down"
+ class="chev"
+ aria-hidden="true"></i>
+ </button>
+
+ <ng-container *ngIf="authoring">
+ <i
+ nz-icon
+ nzType="info-circle"
+ class="lead"
+ aria-hidden="true"></i>
+ <!-- An author edits the heading in place here, not in a separate Title box. -->
+ <input
+ class="instr-title-input"
+ [(ngModel)]="instructionTitle"
+ (ngModelChange)="onInstructionChange()"
+ placeholder="How to use this"
+ aria-label="Instruction heading" />
+ <button
+ type="button"
+ class="instr-toggle instr-chev"
+ [attr.aria-expanded]="instructionOpen"
+ aria-controls="instr-body"
+ [attr.aria-label]="instructionOpen ? 'Collapse the instruction' : 'Expand the instruction'"
+ (click)="toggleInstruction()">
+ <i
+ nz-icon
+ nzType="down"
+ class="chev"
+ aria-hidden="true"></i>
+ </button>
+ </ng-container>
+ </div>
<div
+ id="instr-body"
class="instr-body"
[hidden]="!instructionOpen">
<div
class="md"
+ *ngIf="!authoring"
[innerHTML]="instructionPreviewHtml"></div>
+
+ <ng-container *ngIf="authoring">
+ <div class="tabs">
+ <button
+ type="button"
+ [attr.aria-current]="instructionMode === 'write'"
+ (click)="setInstructionMode('write')">
+ Write
+ </button>
+ <button
+ type="button"
+ [attr.aria-current]="instructionMode === 'preview'"
+ (click)="setInstructionMode('preview')">
+ Preview
+ </button>
+ </div>
+
+ <ng-container *ngIf="instructionMode === 'write'">
+ <textarea
+ class="md-input"
+ [(ngModel)]="instructionBody"
+ (ngModelChange)="onInstructionChange()"
+ placeholder="Explain what this does and what to fill in."></textarea>
Review Comment:
Right, a placeholder is not a name. Fixed in 1c9ed8863: the body carries `aria-label="Instruction body"`, matching the heading's `Instruction heading`; the rendered spec asserts both.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -336,5 +445,30 @@ <h2>{{ instructionTitle || "How to use this" }}</h2>
</div>
</ng-container>
</section>
+
+ <!-- Author picks which earlier steps also report back; the final result always shows. Toggling a
+ pill writes the chosen set; a reader never sees this section. -->
+ <section
+ class="card respick"
+ *ngIf="authoring">
+ <h3>Results shown here</h3>
+ <p>The final result always shows. Toggle an earlier step here to feature its result too.</p>
+ <div class="opts">
+ <button
+ type="button"
+ class="pill"
+ *ngFor="let choice of resultChoices"
+ [class.on]="choice.shown"
+ [attr.aria-pressed]="choice.shown"
+ (click)="onToggleResult(choice)">
Review Comment:
Good catch. Fixed in 1c9ed8863: the pills are tracked by step (`trackBy: trackByChoice`, keyed on the operator id), so the rebuild after a toggle reuses the button and the focus stays on it. The rendered spec focuses a pill, rebuilds the choices as new objects and checks the same element is still there and still focused.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.html:
##########
@@ -61,6 +61,30 @@
</div>
<div class="pc-page">
+ <!-- Only a writer sees Edit, which flips the whole page into in-place authoring; the lede appears
+ only while authoring, to say what edit mode is for. -->
+ <header
+ class="pc-head"
+ *ngIf="canEdit">
Review Comment:
Screenshot pending from the author (edit-mode header with the instruction editor and the result picker); the PR stays a draft until it is in.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8516:
URL: https://github.com/apache/texera/pull/8516#issuecomment-5639430151
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/8516?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `98.50746%` with `2 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 93.88%. Comparing base ([`75c85aa`](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`eeaef60`](https://app.codecov.io/gh/apache/texera/commit/eeaef6025f2e1e5d2d5bea1a52068307f90a1227?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on main.
| [Files with missing lines](https://app.codecov.io/gh/apache/texera/pull/8516?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...mponent/workflow-form/workflow-form.component.html](https://app.codecov.io/gh/apache/texera/pull/8516?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fworkspace%2Fcomponent%2Fworkflow-form%2Fworkflow-form.component.html&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZnJvbnRlbmQvc3JjL2FwcC93b3Jrc3BhY2UvY29tcG9uZW50L3dvcmtmbG93LWZvcm0vd29ya2Zsb3ctZm9ybS5jb21wb25lbnQuaHRtbA==) | 98.71% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/texera/pull/8516?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...component/workflow-form/workflow-form.component.ts](https://app.codecov.io/gh/apache/texera/pull/8516?src=pr&el=tree&filepath=frontend%2Fsrc%2Fapp%2Fworkspace%2Fcomponent%2Fworkflow-form%2Fworkflow-form.component.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZnJvbnRlbmQvc3JjL2FwcC93b3Jrc3BhY2UvY29tcG9uZW50L3dvcmtmbG93LWZvcm0vd29ya2Zsb3ctZm9ybS5jb21wb25lbnQudHM=) | 97.67% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/texera/pull/8516?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #8516 +/- ##
============================================
+ Coverage 93.62% 93.88% +0.25%
Complexity 4857 4857
============================================
Files 1212 1212
Lines 50037 50150 +113
Branches 6132 6145 +13
============================================
+ Hits 46847 47082 +235
+ Misses 1676 1551 -125
- Partials 1514 1517 +3
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.18% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.32% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.85% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.14% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.12% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.65% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.72% <98.50%> (+0.56%)` | :arrow_up: | |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.73% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.47% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/8516/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.09% <ø> (ø)` | | Carriedforward from [75c85aa](https://app.codecov.io/gh/apache/texera/commit/75c85aa7e771d9b3d3c79396b08b196928238858?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/8516?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on PR #8516:
URL: https://github.com/apache/texera/pull/8516#issuecomment-5639544017
/request-review: @mengw15
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994375447
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -1278,11 +1451,24 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
* of yourself, broken runs. A fresh document is the reliable handover.
*/
public openRegularCanvas(): void {
- this.save();
- /* v8 ignore start -- full-document navigation; jsdom cannot navigate */
+ // Save first and hand over only once the save has completed: the full-page load unloads this
+ // document, and a request still in flight at that moment is aborted, so navigating right after
+ // firing the save could lose the very edit the switch is meant to carry across. A save that
+ // fails keeps the author here with the error shown, rather than leaving with changes that were
+ // never stored. A reader, who has nothing to save, goes straight over.
+ this.save(() => this.openCanvasPage());
Review Comment:
Agreed. 6ae880ae0 puts every save through one serial queue (concatMap): the switch's save is sent only after an autosave already in flight has completed, snapshots the workflow when its turn comes, and navigation waits for that save; a failed save reports itself and does not stop the queue. Specs: the ordering with two in-flight persists, the failed-then-successful sequence, and the destroy-time save.
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +548,18 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Lock or unlock editing: the graph and its properties are read-only unless a writer is in edit
+ * mode, which is the only state that unlocks them (see toggleAuthoring).
*/
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ // Edit mode with write access is the only state that makes the operator properties (and the
+ // embedded canvas) modifiable here; every other state locks them, so a reader -- or a writer
+ // just viewing -- cannot change the workflow through this page.
+ if (this.authoring && this.canEdit) {
Review Comment:
Right, and there was a second unlocker besides the execute service: the embedded computing-unit selector re-enables modification when it finds no run on the chosen unit. 6ae880ae0 makes one reducer (edit mode, write access, and no run in flight) and clamps on getWorkflowModificationEnabledStream(): whenever anything unlocks the graph while the page must stay locked, it is locked again. Entering edit mode mid-run therefore stays locked until the run ends; in edit mode the execute service's unlock after the run stands. Specs cover all three transitions.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994403540
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +545,41 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked by the execute service once it ends.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
Review Comment:
This clamp re-locks an author in edit mode after every run. The unlock and the state event arrive in a fixed order: `updateWorkflowActionLock` runs before `executionStateStream.next` (execute-workflow.service.ts:367-380), so when the unlock emission reaches this subscription, `this.executionState` is still the running state — `mayUnlock()` returns false and the clamp disables again. The state event then lands and nothing re-enables, so the live panel and the view-result command stay locked until the author leaves and re-enters edit mode. (Reading the run state from ExecuteWorkflowService instead would not help: its own `currentState` is also updated after the lock call.)
The three new specs pass because the harness emits the state before the unlock — the reverse of the service's real order.
A small fix that keeps the clamp for the other unlockers: also call `applyEditability()` in the execution-state subscription, after `this.executionState = current.state`, so the reducer re-asserts once the state has settled; and flip the specs' emission order to match the service.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994444272
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +551,43 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked once it ends -- the execute service flips the lock
+ * before it emits the new state, so that unlock is clamped here (this page still sees "running")
+ * and given back by the execution-state handler, which re-applies the rule with the new state.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
+ this.workflowActionService.disableWorkflowModification();
Review Comment:
This clamp runs synchronously inside `enableWorkflowModification()`'s `BehaviorSubject.next(true)`. That method emits before its final `undoRedoService.enableWorkFlowModification()` call, so the nested disable emits `false`, then the outer enable resumes and leaves undo/redo enabled; subscribers registered after this clamp can likewise finish processing the stale `true` event. After a run or computing-unit change outside edit mode, keyboard undo and the result toggle can therefore remain active even though the root flag reads false. Reconcile after the enabling call has completed, or move this arbitration into `WorkflowActionService`, so all consumers observe one final locked state.
##########
frontend/src/app/common/type/workflow.ts:
##########
@@ -67,13 +67,16 @@ export interface FormBindingConfig {
};
/** Array order is display order; the author reorders by dragging. */
fields: FormFieldBinding[];
- /** View-result operators whose results are also shown under the workflow after a run, on top of
- * the final step's result, which always shows. */
- resultOperatorIds: string[];
+ /** Which steps' results show under the workflow after a run, for everyone. Absent until the author
+ * chooses: then every final (terminal) step shows, as on the canvas. Once set it is exhaustive:
+ * exactly these steps show, and [] means none. One list, so nothing can contradict it; the cost is
+ * that a step which becomes final after the author has chosen does not appear by itself. When
+ * displayed it is kept to steps that still have a result on the canvas. */
+ shownResultIds?: string[];
Review Comment:
This replaces a persisted field without a compatibility path. Workflows saved by the current main branch contain `formBinding.resultOperatorIds`; `hydrateFormBinding` assigns that JSON unchanged, while all new reads ignore the old property and fall back to terminal-only results. Existing curated intermediate results therefore disappear when opened after this change. Add legacy hydration/migration that preserves the old semantics (current terminals plus `resultOperatorIds`) and cover loading an old serialized workflow.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(gui): add the Form View edit mode, with instruction and result authoring [texera]
Posted by "yangzhang75 (via GitHub)" <gi...@apache.org>.
yangzhang75 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3994482653
##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -510,11 +551,43 @@ export class WorkflowFormComponent implements OnInit, OnDestroy {
}
/**
- * Show the workflow rather than edit it: the graph shape and its properties are read-only
- * on this page. A later PR's authoring mode makes properties editable with write access.
+ * Whether this page may hold the graph unlocked: a writer in edit mode, and no run in flight. The
+ * run rule is the canvas's own (a run locks the graph until it ends), kept here too so that entering
+ * edit mode mid-run cannot undo it. Every other state is locked, so a reader, or a writer merely
+ * viewing, cannot change the workflow through this page.
*/
+ private mayUnlock(): boolean {
+ return this.authoring && this.canEdit && !this.isRunning;
+ }
+
+ /** Lock or unlock editing from the current state (see mayUnlock); the one reducer for both directions. */
private applyEditability(): void {
- this.workflowActionService.disableWorkflowModification();
+ if (this.mayUnlock()) {
+ this.workflowActionService.enableWorkflowModification();
+ } else {
+ this.workflowActionService.disableWorkflowModification();
+ }
+ }
+
+ /**
+ * The lock is a root-level flag with writers that know nothing of this page: the execute service
+ * unlocks it whenever a run ends (completed, failed, killed, reset), the computing-unit selector
+ * unlocks it when it finds no run on the chosen unit, and any future caller may too. Rather than
+ * chase each one, clamp at the one place they all report to: whenever the flag turns on while this
+ * page must stay locked, turn it off again. In edit mode the canvas rule then stands unchanged:
+ * locked while a run is in flight, unlocked once it ends -- the execute service flips the lock
+ * before it emits the new state, so that unlock is clamped here (this page still sees "running")
+ * and given back by the execution-state handler, which re-applies the rule with the new state.
+ */
+ private clampEditability(): void {
+ this.workflowActionService
+ .getWorkflowModificationEnabledStream()
+ .pipe(untilDestroyed(this))
+ .subscribe(enabled => {
+ if (enabled && !this.mayUnlock()) {
+ this.workflowActionService.disableWorkflowModification();
Review Comment:
Right, the nested disable left undo/redo enabled and later subscribers on the stale true. 52339ac34 defers the clamp by one microtask (observeOn(asapScheduler)), so it runs after enableWorkflowModification() has finished and the stream has reached every subscriber; the disable is then the last word and the flag, undo/redo and all consumers agree. In edit mode the execution-state handler has re-applied the rule by then, so the unlock after a run stands. Specs assert the clamp is not synchronous and cover both orders; deleting the deferral turns two of them red.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org