Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visual diffs to syncing #603

Merged
merged 66 commits into from
Apr 2, 2023
Merged

Conversation

boatbomber
Copy link
Member

@boatbomber boatbomber commented Aug 1, 2022

When you initially connect to a serve, it displays a visual diff of all the changes it brings and asks the user to choose how to handle it. This helps prevent accidentally syncing the wrong place, and smooths the path towards proper two-way syncing.

You may choose "Accept" to bring in these changes or "Abort" to cancel and do nothing. For low friction, if the sync is perfect (no differences) it'll just auto accept and finish connecting. When two way sync is enabled there's a third option, "Reject", which syncs your Studio DOM back to your filesystem before connecting. (This is obviously pretty incomplete as two way sync is not quite there yet, but this PR ensures we have the infrastructure and some TODO comments in the right places.)

If your Rojo UI is not open (ie: syncing via keybind without Rojo actually open, or by closing Rojo before accepting/rejecting) it will open the diff in a popup window instead. This will toggle if you toggle the widget in middle so you never need more than one Rojo window open, reducing clutter.

Clicking on an edited instance in the diff will open a dropdown of specific property differences. Color3 values will show a blot of color along with their RGB values, and there is infrastructure to display other datatypes in special ways as well if we find others worth showing as more than text.

For further utility, the "Synced X changes T ago" text on the Connected page can now be clicked to view a visual diff of what those synced changes are. This makes Rojo less opaque and can additionally aid with diagnosing issues.

demo
screenshot

@lankles
Copy link

lankles commented Aug 1, 2022

phenomenal work as always

@KingJesseDev
Copy link

love the icons and ui

@boatbomber boatbomber added the status: in-progress Someone is working on this last time we checked. label Aug 6, 2022
@boatbomber boatbomber marked this pull request as ready for review January 4, 2023 23:32
@boatbomber boatbomber changed the title Add user confirmation to initial sync w/ visual diff Add visual diffs to syncing Jan 27, 2023
@boatbomber boatbomber added type: enhancement Feature or improvement that should potentially happen scope: plugin Relevant to the Roblox Studio plugin size: medium labels Feb 10, 2023
@LPGhatguy LPGhatguy merged commit b5ed952 into rojo-rbx:master Apr 2, 2023
@boatbomber boatbomber deleted the initial-patch-diff branch May 11, 2023 15:36
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
* Add user confirmation to initial sync

* Use "Accept" instead of "Confirm"

* Draw tree alphabetically for determinism

* Add diff table dropdown

* Add diff table to newly added objects

* Unblock keybind workflow

* Only show reject button when two way is enabled

* Try to patch back to the files when changes are rejected

* Improve text spacing of the prop diff table

* Skip user confirmation of perfect syncs

* Give instances names for debugging UI

* Optimize tree building

* Efficiency: dynamic virtual scrolling & lazy rendering

* Simplify virtual scroller logic and avoid wasteful rerenders

* Remove debug print

* Consistent naming

* Move new patch applied callback into accept

* Pcall archivable

* Keybinds open popup diff window

* Theme rows in diff

* Remove relic of prototype

* Color value visuals and better component name

* changeBatcher is not needed when no sync is active

* Simplify popup roact entrypoint

* Alphabetical prop lists and refactor

* Add a stroke to color blot for contrast

* Make color blots animate transparency with the rest of the page

* StyLua formatting on newly added files

* Remove wasteful table

* Fix diffing custom properties

* Display tables more meaningfully

* Allow children in the button components

* Create a rough tooltip component

* Add tooltips to buttons

* Use provider+trigger schema to avoid tooltip ZIndex issues

* Add triangle point to tooltip

* Tooltip underneath instead of covering

* Cancel hovers when unmounting

* Allow multiple canvases from one provider

* Display above or below depending on available space

* Move patch equality to PatchSet.isEqual

* Use Container

* Remove old submodules

* Reduce false positives in diff

* Add debug log

* Fuzzy equals CFrame in diffs to avoid floating point in

* Fix decodeValue usage

* Support the .changedName patches

* Fix content overlapping border

* Fix tooltip tail alignment

* Fix tooltip text fit

* Whoops, fix it properly

* Move PatchVisualizer to Components

* Provide Connected info with full patch data

* Avoid implicit nil return

* Add patch visualizer to connected page

* Make Current column invisible when visualizing applied patches

* Avoid floating point diffs in a numbers and vectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: plugin Relevant to the Roblox Studio plugin size: medium status: needs review This work is mostly done, but just needs work to integrate and merge it. type: enhancement Feature or improvement that should potentially happen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants