Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Add API to mark node VCS status. #1160

Merged
merged 18 commits into from
Feb 12, 2021

Conversation

MichaelMauderer
Copy link
Contributor

@MichaelMauderer MichaelMauderer commented Jan 28, 2021

Pull Request Description

Add API and simple visuals to set node VCS status.

image

Peek.2021-02-02.13-41.mp4

Yellow: node edited
Green: node added.

There is also a demo in the interface debug scene.

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the Rust style guide.
  • All code has automatic tests where possible.
  • All code has been profiled where possible.
  • All code has been manually tested in the IDE.
  • All code has been manually tested in the "debug/interface" scene.
  • All code has been manually tested by the PR owner against our test scenarios.
  • All code has been manually tested by at least one reviewer against our test scenarios.

@MichaelMauderer MichaelMauderer added Difficulty: Intermediate Some prior knowledge required Priority: High Should be scheduled as soon as possible Type: Enhancement An enhancement to the current state of Enso IDE Category: GUI The Graphical User Interface labels Jan 28, 2021
@MichaelMauderer MichaelMauderer self-assigned this Jan 28, 2021
@MichaelMauderer MichaelMauderer marked this pull request as ready for review January 28, 2021 09:54
@farmaazon farmaazon self-requested a review January 29, 2021 09:04
src/rust/ensogl/lib/theme/src/lib.rs Outdated Show resolved Hide resolved
src/rust/ide/view/graph-editor/src/component/node.rs Outdated Show resolved Hide resolved


// === VCS Handling ===
model.vcs_indicator.frp.set_status <+ frp.set_vcs_status.unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Why unwrap? I mean, this prevents us from disabling the vcs status there, right?

Copy link
Member

Choose a reason for hiding this comment

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

Oh I get it, we show and hide the status in next line. I think we should redesign this api towards handling the visibility of the status by the status indicator. So, I'd refactor all these 3 FRP lines to:

model.vcs_indicator.frp.set_status <- frp.set_vcs_status.unwrap();

and handle the visibility inside of vcs_indicator instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea here is that there is a difference between "has no status" and "has a status: it was unchanged". Right now we can easily add a new status for unchanged without much effort. If we change this as proposed, and we decide we want to show some notification for unchanged we need to do much more refactoring.

Also, the point of the logic here is to completely remove the status indicator from the component tree if it is not needed. So instead of having some invisible shape, we remove all the shapes completely, which logically needs to be done by the node to get rid of the whole VCS component if it is not needed.

Comment on lines 21 to 22
/// The node has not been modified.
Unchanged,
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this design as it repeats the ideas of Option instead of reusing it. Instead I' create:

pub enum Change { Added, Edited };
pub type Status = Option<Change>;

src/rust/ide/view/graph-editor/src/component/node/vcs.rs Outdated Show resolved Hide resolved
src/rust/ide/view/graph-editor/src/component/node/vcs.rs Outdated Show resolved Hide resolved
src/rust/ide/view/graph-editor/src/component/node/vcs.rs Outdated Show resolved Hide resolved
src/rust/ide/view/graph-editor/src/lib.rs Outdated Show resolved Hide resolved
src/rust/ide/view/graph-editor/src/lib.rs Outdated Show resolved Hide resolved
src/rust/ide/view/src/debug_scenes/vcs.rs Outdated Show resolved Hide resolved
@wdanilo
Copy link
Member

wdanilo commented Jan 30, 2021

Also, could you please ake a screenshot with both vcs status and node selection visible?

@MichaelMauderer MichaelMauderer changed the title feat: Add API to mark node VCS status. Add API to mark node VCS status. Feb 1, 2021
Base automatically changed from main to develop February 2, 2021 05:08
@MichaelMauderer
Copy link
Contributor Author

@wdanilo Still waiting for manual testing.

# Conflicts:
#	CHANGELOG.md
#	src/rust/ide/view/graph-editor/src/component/node.rs
#	src/rust/ide/view/src/debug_scenes/interface.rs
@MichaelMauderer
Copy link
Contributor Author

Updated to develop. Waiting for testing.

@farmaazon farmaazon merged commit 3c8b4b3 into develop Feb 12, 2021
@MichaelMauderer MichaelMauderer deleted the wip/mm/ide-1097-node-added-changed-marks branch February 26, 2021 13:46
mwu-tow pushed a commit to enso-org/enso that referenced this pull request Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: GUI The Graphical User Interface Difficulty: Intermediate Some prior knowledge required Priority: High Should be scheduled as soon as possible Type: Enhancement An enhancement to the current state of Enso IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants