Skip to content

feat(frontend): mark the public version, open what a listing advertises, and turn pinning on - #8579

Draft
yangzhang75 wants to merge 6 commits into
apache:mainfrom
yangzhang75:pin/7-listings
Draft

yangzhang75 wants to merge 6 commits into
apache:mainfrom
yangzhang75:pin/7-listings

Conversation

@yangzhang75

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Two places outside the share dialog have to agree with the pin, and then the feature is complete.

  • The versions panel marks the version the Hub is serving, as a quiet second line under its
    timestamp rather than a tag: the panel is 230px wide, so horizontal room is scarce while
    vertical room is free. That row is also how an author who has moved on gets the published copy
    back — it is already in the panel, so restoring it is the restore they already know. The panel
    re-reads when the share dialog closes, since that is where the pin can have moved and the panel
    is covered until then.
  • Hub entries open what they advertise. A hub card shows the public copy, so an author whose
    working copy has moved on behind a pin now lands on the published preview — what they just saw,
    and where Clone gives them a copy of it — rather than in their editor showing something else.
    Their own listings are untouched: there the entry is their workflow.
  • The flag goes on. gui.workflow-workspace.version-pinning-enabled flips to true, which is
    what makes the switch appear in the share dialog. It is deliberately the last change of the
    series: every surface that has to agree with a pin is in place by the time an author can make
    one. Nothing downstream needed its own gate — a listing marker and a hub link both depend on a
    pin existing, and no pin can exist while the control is hidden.

Any related issues, documentation, discussions?

Closes #7943
Part of #7828. Design discussion: #7128. Stacked on #7853, #8575, #8576, #8577 and #8578; until
those merge this PR shows their commits too, and the review here is the last one.

This is the PR that turns the feature on. It should merge last.

How was this PR tested?

Frontend: the versions-list spec covers the marker appearing only on the version the Hub serves
and the panel re-reading when the announcement comes; the menu spec covers the announcement being
made when the share dialog closes, and not when the user has just revoked their own access and is
being navigated away; the registry spec covers the routing rule — a hub entry whose public copy
is behind goes to the preview, one that is not goes to the editor, and a private-search row is
never diverted; the card and list specs cover the argument reaching the rule. Full suite passes
(5989), production (AOT) build passes, prettier clean.

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

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

Generated-by: Claude Code (Opus 5)

🤖 Generated with Claude Code

yangzhang75 and others added 6 commits September 16, 2026 12:36
A public workflow follows the author's latest content, as publishing has
always done. This adds the other state: the author pins the version they
have now, and the public copy stops moving until they pin again.

`is_public` stays the on/off switch; `published_content` is the pin, NULL
while following. `WorkflowPublishService` owns the two states, and three
endpoints expose them: POST and DELETE `/workflow/pin/{wid}` to pin and
unpin, GET `/workflow/publish-status/{wid}` for what the author is shown.
Publishing and unpublishing move through the same service, so unpublishing
drops the pin rather than leaving a private workflow carrying one.

Two paths are narrowed so a pin can hold. A save wrote the whole row back,
so a publish landing while a save was in flight was silently rolled back,
and a request body could set the publish columns itself; saves now write
only name, description and content. Creating a workflow clears the publish
columns for the same reason.

Nothing reads the pinned copy yet: every workflow is in the following
state it is in today, and nothing on screen changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
With a version pinned, a workflow has two copies: the author's working
copy and the frozen one on public show. This routes every read that
serves a viewer without granted access through the frozen copy, and
freezes the name and description with the graph.

`WorkflowPublishService.publicCopyOf` returns the three fields as a
group, so a surface cannot pick up the published graph under a title the
author has not published; `WorkflowAccessResource.hasGrantedAccess` is
the seam that decides which copy a caller gets. Granted access -- owner,
shared, project member -- keeps tracking the author's latest, because
sharing is not publishing.

Name and description freeze because they are as public as the graph: if
only the graph froze, a report about a title could be answered by editing
the title while the pinned copy still advertised it.

Routed through it: opening a workflow, the hub's read, Clone, Duplicate,
`/workflow_name`, `/workflow_description` and the size a listing shows.
A workflow that follows the author's latest -- every workflow today --
is served exactly what it is served now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Search and the listings it feeds were reading the author's live columns,
which for a pinned workflow is the one copy the public cannot open. A
draft would turn up in a public search under a title nobody has seen, and
the card would advertise a name the detail page does not show.

Each filter is now applied to whichever copy the caller may see:
`onVisibleCopy` builds the same filter twice -- over the live columns for
rows the caller was granted access to, over the frozen ones for rows they
reach only because the workflow is public -- and ORs the two. A
disjunction over bare columns rather than a CASE, so each side stays
eligible for its own fulltext index. Unpinned public rows fall back to
the live columns, so a following workflow searches exactly as it does now.

Listings carry two more things from the same query: the frozen name and
description to show a viewer without granted access, and whether the copy
on show is behind the author's working copy. `constructWhereClause` takes
`includePublic` for this; the other builders accept and ignore it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…tises

Two places outside the share dialog have to agree with the pin.

The versions panel marks the version the Hub is serving, as a quiet
second line under its timestamp. That row is also how an author who has
moved on gets the published copy back: it is already in the panel, so
restoring it is the restore they already know. The panel re-reads when
the share dialog closes, since that is where the pin can have moved and
the panel is covered until then.

Hub entries open what they advertise. A hub card shows the public copy,
so an author whose working copy has moved on behind a pin now lands on
the published preview -- what they just saw, and where Clone gives them a
copy of it -- rather than in their editor showing something else. Their
own listings are untouched: there the entry is their workflow, and it
opens the editor as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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

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: @aglinxinyuan, @tanishqgandhi1908, @mengw15
    You can notify them by mentioning @aglinxinyuan, @tanishqgandhi1908, @mengw15 in a comment.

@codecov-commenter

codecov-commenter commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.41317% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.90%. Comparing base (f9b899a) to head (2357f74).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...shboard/user/workflow/WorkflowPublishService.scala 85.10% 1 Missing and 6 partials ⚠️
...t-panel/versions-list/versions-list.component.html 40.00% 3 Missing ⚠️
...ponent/user/share-access/share-access.component.ts 97.67% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8579      +/-   ##
============================================
- Coverage     92.91%   92.90%   -0.01%     
- Complexity     4884     4888       +4     
============================================
  Files          1224     1236      +12     
  Lines         51298    51909     +611     
  Branches       6322     6397      +75     
============================================
+ Hits          47664    48228     +564     
- Misses         2070     2104      +34     
- Partials       1564     1577      +13     
Flag Coverage Δ *Carryforward flag
access-control-service 71.78% <ø> (ø)
agent-service 99.32% <ø> (ø) Carriedforward from 8e67384
amber 88.96% <89.55%> (-0.05%) ⬇️ Carriedforward from 8e67384
computing-unit-managing-service 54.61% <ø> (ø)
config-service 87.50% <100.00%> (+0.24%) ⬆️
file-service 81.53% <ø> (ø)
frontend 96.60% <95.95%> (-0.09%) ⬇️
notebook-migration-service 83.73% <ø> (ø)
pyamber 98.47% <ø> (ø) Carriedforward from 8e67384
workflow-compiling-service 74.09% <ø> (ø)

*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

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 471e53c 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 397 0.242 23,128/38,481/38,481 us 🔴 +17.3% / 🔴 +157.0%
🟢 bs=100 sw=10 sl=64 938 0.573 105,355/124,151/124,151 us 🟢 -15.0% / 🔴 +24.2%
bs=1000 sw=10 sl=64 1,084 0.662 925,768/985,701/985,701 us ⚪ within ±5% / ⚪ within ±5%
Baseline details

Latest main 471e53c from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 397 tuples/sec 447 tuples/sec 839.58 tuples/sec -11.2% -52.7%
bs=10 sw=10 sl=64 MB/s 0.242 MB/s 0.273 MB/s 0.512 MB/s -11.4% -52.8%
bs=10 sw=10 sl=64 p50 23,128 us 22,347 us 11,937 us +3.5% +93.8%
bs=10 sw=10 sl=64 p95 38,481 us 32,816 us 14,976 us +17.3% +157.0%
bs=10 sw=10 sl=64 p99 38,481 us 32,816 us 19,204 us +17.3% +100.4%
bs=100 sw=10 sl=64 throughput 938 tuples/sec 922 tuples/sec 1,096 tuples/sec +1.7% -14.4%
bs=100 sw=10 sl=64 MB/s 0.573 MB/s 0.563 MB/s 0.669 MB/s +1.8% -14.3%
bs=100 sw=10 sl=64 p50 105,355 us 103,069 us 94,033 us +2.2% +12.0%
bs=100 sw=10 sl=64 p95 124,151 us 146,046 us 99,939 us -15.0% +24.2%
bs=100 sw=10 sl=64 p99 124,151 us 146,046 us 110,148 us -15.0% +12.7%
bs=1000 sw=10 sl=64 throughput 1,084 tuples/sec 1,100 tuples/sec 1,128 tuples/sec -1.5% -3.9%
bs=1000 sw=10 sl=64 MB/s 0.662 MB/s 0.671 MB/s 0.688 MB/s -1.3% -3.8%
bs=1000 sw=10 sl=64 p50 925,768 us 909,445 us 921,191 us +1.8% +0.5%
bs=1000 sw=10 sl=64 p95 985,701 us 958,191 us 959,735 us +2.9% +2.7%
bs=1000 sw=10 sl=64 p99 985,701 us 958,191 us 988,604 us +2.9% -0.3%
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,503.96,200,128000,397,0.242,23128.24,38480.89,38480.89
1,100,10,64,20,2131.99,2000,1280000,938,0.573,105355.45,124150.69,124150.69
2,1000,10,64,20,18446.39,20000,12800000,1084,0.662,925768.46,985701.08,985701.08

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: mark the public version and open what a listing advertises

2 participants