Skip to content

feat(frontend): choose between following and pinning in the share dialog - #8578

Draft
yangzhang75 wants to merge 2 commits into
apache:mainfrom
yangzhang75:pin/6-panel
Draft

yangzhang75 wants to merge 2 commits into
apache:mainfrom
yangzhang75:pin/6-panel

Conversation

@yangzhang75

@yangzhang75 yangzhang75 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Everything so far has been machinery with nothing to drive it. This is the control: in the share
dialog, a published workflow gets a two-way switch for what the public sees.

  • Two states, so the control is a switch. Follow latest is what Texera does today — the
    public sees the author's latest, updated on every save. Pinned holds the version they froze.
    Both choices stay on screen, so the author reads what the options are instead of inferring one
    from the label of the other.
  • Everything under the switch describes the side it is on — a fact, not a warning: keeping an
    older version public is a legitimate choice. Green while the public has everything, amber once a
    pin is holding a version back.
  • Only the pinned side has more to say. Behind, that is the one decision the state leaves
    open, so it gets a card: which version is out there, what it costs, and the act that ends it.
  • The panel describes the saved copy, and the editor saves on a debounce, so it re-reads when
    a save lands. Deliberately it does not force a save first: the canvas is not always the workflow
    — it is empty while one loads, and stays empty if the collaborative model never arrives — so a
    save nobody asked for could write that emptiness over every operator the workflow had.

Behind a flag, off. gui.workflow-workspace.version-pinning-enabled defaults to false, so
merging this changes nothing anyone can see: the dialog is exactly what it is today and does not
even ask the server about a state it cannot show. The last PR of the series turns it on, so the
feature appears only once every surface that has to agree with a pin is in place.

Any related issues, documentation, discussions?

Closes #7942
Part of #7828. Design discussion: #7128. Stacked on #8577; until that merges this PR shows
its commit too, and the review here is the last one.

How was this PR tested?

Frontend: the share-access spec covers the panel end to end — each of the three states and the
sentence it shows, the switch calling pin and unpin and doing nothing when the side already in
force is picked, "Update to current" asking for a re-pin, the date the card names, failures
surfacing as a notification, the panel staying hidden for a workflow that is not published and
for a user who cannot publish, and the re-read when a save lands. One case covers the flag being
off: nothing renders and the status endpoint is not called. The persist spec covers the new
pin/unpin/status calls and that a save is announced when it lands rather than when it is sent.
Full suite passes (6602), production (AOT) build passes, prettier clean.

Backend: GuiConfigSpec pins the flag's default to off (72 tests); the dashboard package passes
(572); scalafmt clean.

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

Generated-by: Claude Code (Opus 5)

🤖 Generated with Claude Code

@github-actions github-actions Bot added engine frontend Changes related to the frontend GUI common platform Non-amber Scala service paths labels Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @zyratlo, @mengw15, @aglinxinyuan
    You can notify them by mentioning @zyratlo, @mengw15, @aglinxinyuan in a comment.

@codecov-commenter

codecov-commenter commented Sep 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.81%. Comparing base (e9e5fda) to head (bf4a6eb).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8578      +/-   ##
============================================
- Coverage     91.81%   91.81%   -0.01%     
  Complexity     5021     5021              
============================================
  Files          1277     1277              
  Lines         56381    56365      -16     
  Branches       7362     7361       -1     
============================================
- Hits          51765    51749      -16     
  Misses         2762     2762              
  Partials       1854     1854              
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.53% <ø> (ø) Carriedforward from e9e5fda
amber 85.76% <ø> (-0.01%) ⬇️ Carriedforward from e9e5fda
computing-unit-managing-service 64.05% <ø> (ø)
config-service 87.85% <100.00%> (+0.11%) ⬆️
file-service 82.31% <ø> (ø)
frontend 96.54% <ø> (-0.01%) ⬇️ Carriedforward from e9e5fda
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.50% <ø> (ø) Carriedforward from e9e5fda
workflow-compiling-service 78.30% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main e9e5fda benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 387 0.236 24,872/32,391/32,391 us 🔴 +10.3% / 🔴 +128.3%
🔴 bs=100 sw=10 sl=64 818 0.499 117,942/177,951/177,951 us 🔴 +24.8% / 🔴 +84.7%
🔴 bs=1000 sw=10 sl=64 961 0.587 1,033,235/1,142,365/1,142,365 us 🔴 +6.4% / 🔴 +24.4%
Baseline details

Latest main e9e5fda from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 387 tuples/sec 406 tuples/sec 880.16 tuples/sec -4.7% -56.0%
bs=10 sw=10 sl=64 MB/s 0.236 MB/s 0.248 MB/s 0.537 MB/s -4.8% -56.1%
bs=10 sw=10 sl=64 p50 24,872 us 22,546 us 11,544 us +10.3% +115.4%
bs=10 sw=10 sl=64 p95 32,391 us 35,899 us 14,186 us -9.8% +128.3%
bs=10 sw=10 sl=64 p99 32,391 us 35,899 us 17,122 us -9.8% +89.2%
bs=100 sw=10 sl=64 throughput 818 tuples/sec 858 tuples/sec 1,151 tuples/sec -4.7% -28.9%
bs=100 sw=10 sl=64 MB/s 0.499 MB/s 0.524 MB/s 0.703 MB/s -4.8% -29.0%
bs=100 sw=10 sl=64 p50 117,942 us 116,368 us 89,900 us +1.4% +31.2%
bs=100 sw=10 sl=64 p95 177,951 us 142,559 us 96,346 us +24.8% +84.7%
bs=100 sw=10 sl=64 p99 177,951 us 142,559 us 110,344 us +24.8% +61.3%
bs=1000 sw=10 sl=64 throughput 961 tuples/sec 979 tuples/sec 1,189 tuples/sec -1.8% -19.2%
bs=1000 sw=10 sl=64 MB/s 0.587 MB/s 0.598 MB/s 0.726 MB/s -1.8% -19.1%
bs=1000 sw=10 sl=64 p50 1,033,235 us 1,015,102 us 873,675 us +1.8% +18.3%
bs=1000 sw=10 sl=64 p95 1,142,365 us 1,073,319 us 918,440 us +6.4% +24.4%
bs=1000 sw=10 sl=64 p99 1,142,365 us 1,073,319 us 953,075 us +6.4% +19.9%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,516.35,200,128000,387,0.236,24871.86,32390.78,32390.78
1,100,10,64,20,2446.33,2000,1280000,818,0.499,117941.95,177951.46,177951.46
2,1000,10,64,20,20808.89,20000,12800000,961,0.587,1033234.81,1142364.81,1142364.81

@yangzhang75
yangzhang75 force-pushed the pin/6-panel branch 4 times, most recently from 831ab86 to d741134 Compare September 28, 2026 21:13
@yangzhang75
yangzhang75 marked this pull request as ready for review October 6, 2026 18:42
@yangzhang75
yangzhang75 marked this pull request as draft October 7, 2026 01:36
@yangzhang75
yangzhang75 force-pushed the pin/6-panel branch 3 times, most recently from 85222a2 to 624ffc5 Compare October 13, 2026 00:55
@yangzhang75
yangzhang75 force-pushed the pin/6-panel branch 2 times, most recently from 60eb8fd to 0332da9 Compare October 18, 2026 22:08
@yangzhang75
yangzhang75 force-pushed the pin/6-panel branch 2 times, most recently from 4e54dc7 to 2b34ba4 Compare November 5, 2026 09:54
yangzhang75 and others added 2 commits November 10, 2026 14:21
The author can pin a version, and their working copy then moves on. This
gives them a way back to what the public is seeing: pinning leaves an
anchor in the revision history they already use, and the panel marks it
as the one currently public, so restoring the published version is the
restore they already know.

The anchor is a version row whose delta is the identity patch, so
replaying it returns exactly what was pinned however many edits pile up
after. An existing row cannot stand in: a version row replays to the
content as it was *before* the change it records. Pinning content that is
already the pinned one reuses its anchor rather than adding a twin, and
the read that decides takes a row lock so two pins racing cannot both
insert.

Two consequences the anchor forces:

- It must not start the version panel's aggregation window. It lands
  seconds after the save it freezes, and the panel folds close-together
  versions into the newest, which would hide the author's own save behind
  a row they never made.
- The revision history is now readable only with granted access, or while
  nothing is pinned. Replaying a version folds deltas back from the
  author's current content, so listing versions of a pinned workflow would
  hand a public viewer the very edits the pin is holding back.

`publish-status` carries the pinned version's date, read from the version
row so the dialog and the panel print one value rather than two clocks'.

Co-Authored-By: Claude Opus 5 <[email protected]>
The share dialog said whether a workflow was public and nothing about
which copy the public was getting. With pinning that is now a choice, so
the dialog carries it: a two-option control -- Follow latest, or Pinned --
under the Public tile, plus a line naming the pinned version by the date
it went public.

Follow latest is the default and is exactly what publishing does today.
Pinning freezes the version the author has now; while a pin is in place
and their working copy has moved on, the panel says so and offers Update
to current, which is the only way those edits reach the public.

The panel re-reads its state when a save lands rather than on a timer:
`WorkflowPersistService` now emits on persist, rename and re-describe,
which is what makes "your edits are not public yet" appear as soon as the
autosave lands rather than the next time the dialog is opened. Publishing
returns the state it produced, so the panel does not have to ask again.

Co-Authored-By: Claude Opus 5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine frontend Changes related to the frontend GUI platform Non-amber Scala service paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend: choose between following and pinning in the share dialog

2 participants