Repository navigation
Sandbox sync UI - #5235
Sandbox sync UI#5235josephjclark wants to merge 26 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Based on review, nothing here falls into S0/S1/S2 scope — the main change surface is UI reorganization and documentation updates. Writing up the pass review now. Security Review ✅
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The docs banner now uses the shared alert, and the format switch uses the shared toggle. The toggle is on for openfn.yaml and off for legacy config.json, so the custom event that flipped it is gone. The CLI commands get copy buttons using the existing Copy hook.
The box was bright amber, and on import it set amber and red backgrounds at once. It now uses pale yellow or pale red with a border, smaller text, and file paths that wrap under their icon.
The connect GitHub button now uses the shared button, so it matches the others and is really disabled when GitHub sync is limited. Before, it only looked disabled. The GitHub cards use the same spacing as the other cards. The format toggle moves above the submit button, with the same gap as the rest of the form.
The copy buttons sit in a tooltip wrapper, so hovering shows "Copy to clipboard" and clicking shows "Copied!". They also get a pointer cursor and a centred icon.
The shared toggle could only mean "use openfn.yaml", which read the wrong way round. This restores the hand-built switch, where on means the legacy format.
lmac-1
left a comment
There was a problem hiding this comment.
Hey Joe! Frank said it was okay to do some changes directly in the branch. I did some tidying to use existing shared components to make it easier for the ongoing design system work and caught some small things on the way. Hope that it's okay! Here's a summary of what I tidied up:
Shared components:
- The docs banner now uses the shared alert
Common.alert - The connect GitHub button now uses the shared
button_link. It matches the other buttons and is really disabled when GitHub sync is limited. Before it only looked disabled. - The CLI copy buttons use the existing Copy hook inside a tooltip wrapper. Hovering shows "Copy to clipboard" and clicking shows "Copied!"
Fixes:
- The confirm box only shows once a branch is picked. Before, it showed with empty repo and branch names, because an empty string passed the check. I also added a test
- The confirm box is toned down: pale yellow (or pale red for import) with a border, smaller text, and long paths wrap under their icon
- The "properly configured" banner is now vertically centred.
Layout
- The legacy format switch sits above the submit button, so the choice comes before the action
- The GitHub cards use the same spacing as the other cards.
Wording:
- Sync subtitle: "Sync your project with GitHub, export it, or work on it with the CLI"
- Initial setup: "Export this project to GitHub, or replace it with a project that's already on GitHub"
- Connect card: "You need to do this before you can set up sync"
- CLI card: "Use the OpenFn CLI to work on this project on your computer. Learn more in the CLI sync docs". I moved the docs link up from the bottom of the card.
- Headings are now sentence case so that it's consistent with the rest of the app.
One thing I fixed and then reverted: I switched the code to use the shared toggle but then realised it wasn't nice. Using the shared one means it can only mean "on = openfn.yaml" which read weirdly.
I've also left some inline comments on wording that I wasn't sure about.
More generally, I still find this page a bit hard to follow, even with these changes. Mainly the references to different formats (legacy, v1, v2, config.json and open.yaml all show up and I'm not clear what the different choice means). Not to block this PR but I think we can do a bit more with the wording/UX before this goes live in a follow up.
| class="text-xs text-gray-600" | ||
| > | ||
| This connection uses the legacy sync format (config.json). Reconnect to update to v2 sync formats | ||
| </p> |
There was a problem hiding this comment.
This is still confusing text for me. If I haven't changed anything I might be confused by this and what it means. Perhaps we could link to documentation explaining how to switch to the newer configuration instead?
| "openfn project pull #{@project.id}"}, | ||
| {"Push local changes back to this project:", | ||
| "openfn project deploy"}, | ||
| {"Run a workflow:", "openfn <workflow-name>"} |
There was a problem hiding this comment.
Just wondering whether we should have a "Run a workflow" command on a page about syncing?
There was a problem hiding this comment.
Yeah, debatable, I just figured it's something users are likely to want. It's also a good way to advertise this functionality - so on reflection yeah, I'll keep it. I'm gonna add a second docs link to more usage examples though.
|
Hmm, it looks |
|
@lmac-1 putting the legacy button beneath the Connect button was a deliberate choice to de-emphasise it. Users shouldn't be using it, and want to minimize the control as much as possible. I'm tempted to use an old-school checkbox rather than that big button too. I'd love to remove it entirely, but my spidey sense tells me we should have some sort of fallback (ie, a v1 production repo needs to reconnect sync and absolutely does not want to restructure their GH repo) EDIT: Oh, but if you hit the switch then we show the config path and that DOES need to be above the button. Ok, this is fine :) |
|
@lmac-1 @midigofrank Ready for re-review Btw @lmac-1 GH sync is just intrinsically complex. There are a couple of hard questions users have to ask. I think I've managed to simplify the language here but going further requires a deep redesign of the UI and maybe even whole UX - which is way out of scope for this. I shouldn't even be doing the simplify work really! The only aim here is a) consolidate all sync settings under a single tab and b) use v2 by default |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5235 +/- ##
=======================================
+ Coverage 91.4% 91.5% +0.1%
=======================================
Files 465 465
Lines 23416 23440 +24
=======================================
+ Hits 21399 21440 +41
+ Misses 2017 2000 -17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|


Description
This PR reworks the Sync tab on project settings (previously "Sync to
GitHub") and the GitHub connection form inside it. It is a UI and copy pass; no
schema or context changes.
Screenshots
Changes
Sync tab
github_enabledcheck, so export is available even when GitHub isn'tconfigured on the instance.
openfn project pull <id>,openfn project deployand running a workflow, plus a link to the docs.New connection form
into the form card.
queries, 220px minimum per box). Three across when there's room, then
Installation and Repository with the help text below and Branch on its own.
openfn.yamlformat. The old "Advanced"disclosure is replaced by a "Use legacy YAML config format" switch below the
submit button.
Connected state
the card.
Sync".
suggesting a reconnect; v2 connections show nothing. "Path to config" is
hidden for v2.
Validation steps
/projects/:id/settings#vcson a project with GitHub configured (seeDEPLOYMENT.md, "GitHub", for the app setup and env vars).widths. Try the filter box on Repository and Branch.
its state. Connect, and confirm the saved connection has the matching format.
Remove integration button and its confirmation modal. Check a v1 connection
shows the legacy note and v2 shows neither the note nor "Path to config".
an instance with no GitHub app configured.
Additional notes for the reviewer
custom-selectinnew_inputs.exgains anopt-in
searchableattribute, backed by a newSearchableSelecthook(
assets/js/hooks/SearchableSelect.ts). Other selects are unaffected, butit is the one piece of reusable code here. The filter box uses
form="none"so typing doesn't fire the surrounding form's
phx-change; worth checkingthat holds. Only filtering and Enter-to-select were added, not arrow-key
navigation.
sync_versionschema and DB default stayfalse, so existing connections and any non-UI callers keep the legacyformat. Only the new-connection form starts at
true. The legacy switchupdates
sync_versionthrough the changeset's params (form fields readparams before changes). The "Import from GitHub" direction hides the switch,
so it still falls back to legacy as before.
docs.openfn.org/documentation/link-to-GitHub, which looks like aplaceholder. The CLI card links to
docs.openfn.org/documentation/sync.Please confirm both before merging.
test/integration/cli_deploy_test.exs(
project pull <id>,project deploy), not from the CLI's own docs.three assertions in
project_live_test.exs(around lines 6552, 6607 and6662) look for "Remove Integration", which is now "Remove integration".
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)