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

Select Instances from diff tree #709

Merged
merged 11 commits into from
Jul 9, 2023

Conversation

boatbomber
Copy link
Member

@boatbomber boatbomber commented Jul 4, 2023

Closes #707.

Double clicking selects the Instance, if the Instance exists. Single clicking opens the changes list, if changes exist.

Tooltips indicate which actions are available for the underlying DOM element.

2023-07-04.12-52-46.mp4

@boatbomber boatbomber added type: enhancement Feature or improvement that should potentially happen scope: plugin Relevant to the Roblox Studio plugin size: small impact: small Minor papercuts in Rojo that don't warrant immediate resolutoin. status: needs review This work is mostly done, but just needs work to integrate and merge it. labels Jul 4, 2023
@chriscerie
Copy link
Contributor

Great change. It's not immediately obvious that right click selects the instance. Especially when the behavior allows selection for left click without a changes table, I would just think that selecting is only possible for instances without changes. I'd suggest either:

  • having double click select instances
  • having select be the default activated behavior and including dropdown arrow to expand changes
  • including tooltip when hovering to indicate right click to select

@boatbomber
Copy link
Member Author

Thanks for the feedback!

  • Double click seems good, and ties in with the mental model of opening files on a computer so it should be intuitive. Good idea!
  • Viewing the dropdown is the primary action, plus horizontal space is pretty tight so a dropdown arrow is a no go
  • A tooltip is a good call, I keep forgetting to add those!

Copy link
Contributor

@chriscerie chriscerie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selecting instances probably shouldn't also trigger dropdown expansion. Otherwise if a user already has it expanded and want to select the instance, they'd need to select it and open changes back up.

The delay here can be up to debate. Microsoft has 500ms as the default, but I find 200-300ms to be sufficient for this case.

plugin/src/App/Components/PatchVisualizer/DomLabel.lua Outdated Show resolved Hide resolved
@boatbomber boatbomber enabled auto-merge (squash) July 5, 2023 02:36
Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, as a miner pet peeve, I've noticed that it this seems to only work for the top-level of a change's tree.

As an example, if a patch like this is present:
image
you could double click on Common to select it in the explorer but not Hello.

My expected behavior would be that it would work for both. Is that something that can be easily fixed?

@chriscerie
Copy link
Contributor

chriscerie commented Jul 5, 2023

@Dekkonot Is this for connecting to rojo? It’s only able to select it in the explorer if it exists. It looks like you’re adding the script than modifying it (assuming green + is instance addition)

@Dekkonot
Copy link
Member

Dekkonot commented Jul 5, 2023

@Dekkonot It’s only able to select it in the explorer if it already exists. It looks like you’re adding the script than modifying it (assuming green + is instance addition)

This is on initial sync into a new place file and then I'm clicking through the patch visualizer after confirming that sync. I was surprised it worked with Common since I thought as you did that it wouldn't work for additions. Given that it worked though, my expectation would be that it worked on all additions.

@boatbomber
Copy link
Member Author

That's odd. If the instance exists (and the instanceMap is aware), it should be clickable.

@chriscerie
Copy link
Contributor

chriscerie commented Jul 6, 2023

It looks like instance isn't being passed to addition nodes. Passing the instance here should fix it.

changeList = changeList,
})

-	for _, change in patch.added do
+	for id, change in patch.added do

		...
		
		tree:addNode(change.Parent, {
			id = change.Id,
			patchType = "Add",
			className = change.ClassName,
			name = change.Name,
			hint = hint,
			changeList = changeList,
+			instance = instanceMap.fromIds[id],
		})
	end

@boatbomber
Copy link
Member Author

Good catch, thanks guys!

@boatbomber boatbomber requested review from Dekkonot and chriscerie July 7, 2023 05:43
@boatbomber boatbomber merged commit 7ef4a1f into rojo-rbx:master Jul 9, 2023
@boatbomber boatbomber deleted the select-from-tree branch July 9, 2023 02:34
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: small Minor papercuts in Rojo that don't warrant immediate resolutoin. scope: plugin Relevant to the Roblox Studio plugin size: small 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.

Click to select item in initial sync diff viewer
3 participants