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

DOCS-2550: Add from one machine to many how-to #3201

Merged
merged 9 commits into from
Aug 9, 2024

Conversation

JessamyT
Copy link
Collaborator

@JessamyT JessamyT commented Aug 6, 2024

Icons are stand-ins; could replace with more screenshots, and I'm seeing if Cristina has something similar if we want icons not screenshots

https://docs-test.viam.dev/3201/use-cases/one-to-many/

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Aug 6, 2024

{{< table >}}
{{% tablestep link="/configure/" %}}
{{<imgproc src="/use-cases/one-to-many/config.png" resize="700x" class="fill alignleft" style="max-width: 250px" declaredimensions=true alt="Configuration builder UI">}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an interesting approach but the screenshots are too small to be useful. If Cristina can create something that's great, if not I think use the full screenshots and add them in each step rather than to the side. Like in https://docs-test.viam.dev/3201/use-cases/configure/.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Alternatively what we could do is keep these as small screenshots and make them clickable to expand

Copy link
Collaborator

Choose a reason for hiding this comment

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

#3206 adds functionality for it either way

{{<imgproc src="/use-cases/one-to-many/noun-reset.svg" class="fill alignleft" style="max-width: 100px" declaredimensions=true alt="Reset to fragment">}}
**2. (Optional) Revert fragment modifications**

When you make edits to fields in your machine's config, a top-level section called `"fragment_mods"` is added to your JSON config with [update operators](https://www.mongodb.com/docs/manual/reference/operator/update/positional/#---update-) that modify each field you edit.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check Natalia's email on "overwrite fragments". I believe this has a UI now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it does, and I have them use the UI in step 1 but didn't realize there was a revert button because I didn't see it yesterday :D Yay!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(done)

Copy link
Collaborator

@npentrel npentrel left a comment

Choose a reason for hiding this comment

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

Good start. Just need to tidy up images and overwrites

docs/fleet/fragments.md Outdated Show resolved Hide resolved
@@ -175,170 +130,177 @@ This example assumes the fragment with ID `abcd7ef8-fa88-1234-b9a1-123z987e55aa`
5. Add any update operators you'd like to apply to the fragment to the `mods` section.
Click to view each example:

{{< expand "Change the name and attributes of a component" >}}
This example uses [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/#mongodb-update-up.-set) to make the following changes to the attributes of a motor named `motor1`:
{{< expand "Change the name and attributes of a component" >}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewers: I didn't change any of the expander content, just un-indented to fix formatting bug after putting this into tabbed content

@JessamyT JessamyT requested a review from npentrel August 7, 2024 23:25
@@ -9,6 +9,10 @@ aliases:
- /fleet/configure-a-fleet/
---

{{< cards >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this needs to have some intro

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

eh?

Suggested change
{{< cards >}}
_This page contains reference information.
For a how-to guide, click here:_
{{< cards >}}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or, a la data capture:

Suggested change
{{< cards >}}
Get started with a how-to guide or keep reading for more details.
{{< cards >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the second but maybe after line 39?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay. Adding a heading back in too for less confusion.

docs/fleet/fragments.md Outdated Show resolved Hide resolved
Comment on lines 48 to 49
- Copy and paste the contents of the fragment, remove the link to the fragment itself, then modify the config as needed.
- If you use this method, future updates to the fragment _will not_ be automatically pushed to your machine.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think possibly this is not an option we should highlight. We only did this as a workaround I think. @nataliajacobowitz what do you think?

{{% alert title="Support Notice" color="note" %}}

`fragment_mods` are _not_ supported for the modification of [trigger](/configure/triggers/) configuration.
You can create a trigger with a fragment but you cannot modify it with `fragment_mods`.

{{% /alert %}}

To configure fragment mods:
### Use `fragment_mods`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### Use `fragment_mods`
### Overwrite fragments to add machine-specific modifications

I think overwrites is what the feature is called rather than fragment_mods. @nataliajacobowitz - thought?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@JessamyT elet's move forward with overwrites please. Either the above or this:

Suggested change
### Use `fragment_mods`
### Overwrite fragment fields

Copy link
Collaborator

Choose a reason for hiding this comment

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

In fact you could also remove this and the revert fragment mods titles.

docs/use-cases/one-to-many.md Outdated Show resolved Hide resolved
docs/use-cases/one-to-many.md Outdated Show resolved Hide resolved
docs/use-cases/one-to-many.md Show resolved Hide resolved
docs/use-cases/one-to-many.md Outdated Show resolved Hide resolved

{{% /tablestep %}}
{{% tablestep %}}
{{<imgproc src="/use-cases/one-to-many/trash-can.svg" class="fill alignleft" style="max-width: 50px" declaredimensions=true alt="Delete">}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This icon seems a different size to the other one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes because the line weights are very different. the larger one is from Cristina and has a much lighter weight to it so making that one small makes it almost disappear. We don't have all the icons that would be useful, but in the interest of moving forward I thought better to work with what we have.

I can just take out all the icons and have no images on the non-screenshot steps if you prefer?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it looks fine on mobile but untidy on desktop. Why don't you follow the pattern you've established and take a picture of the delete menu item on a configuration panel?

@npentrel
Copy link
Collaborator

npentrel commented Aug 7, 2024

Good changes, this is getting close. Thanks for the revisions


{{< table >}}
{{% tablestep %}}
{{<imgproc src="appendix/try-viam/rover-resources/fragments/fragments_list.png" resize="800x" class="fill alignleft" style="max-width: 300px" declaredimensions=true alt="Add fragment">}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should have the imgzoom class


{{% /tablestep %}}
{{% tablestep %}}
{{<imgproc src="/use-cases/one-to-many/trash-can.svg" class="fill alignleft" style="max-width: 50px" declaredimensions=true alt="Delete">}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it looks fine on mobile but untidy on desktop. Why don't you follow the pattern you've established and take a picture of the delete menu item on a configuration panel?


{{< table >}}
{{% tablestep link="/fleet/fragments/#modify-the-config-of-a-machine-that-uses-a-fragment" %}}
{{<imgproc src="/use-cases/one-to-many/edit.svg" class="fill alignleft" style="max-width: 50px" declaredimensions=true alt="Edit">}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

And then here maybe show a picture of the edits?

Screenshot 2024-08-08 at 18 28 21

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mm but they won't see this unless they click advanced... I'll add mention of that

@@ -9,6 +9,10 @@ aliases:
- /fleet/configure-a-fleet/
---

{{< cards >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the second but maybe after line 39?


{{< table >}}
{{% tablestep link="/fleet/fragments/#modify-the-config-of-a-machine-that-uses-a-fragment" %}}
{{<gif webm_src="/how-tos/fragment-overwrite.webm" mp4_src="/how-tos/fragment-overwrite.mp4" alt="A robot drawing a heart" max-width="500px" class="aligncenter" >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

that's very pretty

Comment on lines 51 to 55
If you need to modify the config of just one machine that uses a fragment, you have two options:

- Use `fragment_mods` in your machine's config to overwrite certain fields of the fragment.
- Copy and paste the contents of the fragment, remove the link to the fragment itself, then modify the config as needed.
- If you use this method, future updates to the fragment _will not_ be automatically pushed to your machine.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's just remove it please. The old way was a hack. I am reasonably certain we no longer want to do this:

Suggested change
If you need to modify the config of just one machine that uses a fragment, you have two options:
- Use `fragment_mods` in your machine's config to overwrite certain fields of the fragment.
- Copy and paste the contents of the fragment, remove the link to the fragment itself, then modify the config as needed.
- If you use this method, future updates to the fragment _will not_ be automatically pushed to your machine.
If you need to modify the config of one or a few machines that use a fragment, you can overwrite fields of the fragment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

@npentrel npentrel left a comment

Choose a reason for hiding this comment

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

Please accept the remaining suggestions and then merge. Thank you - this looks great

@viambot
Copy link
Member

viambot commented Aug 9, 2024

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/3201

@JessamyT JessamyT merged commit 6e3d842 into viamrobotics:main Aug 9, 2024
8 checks passed
@JessamyT JessamyT deleted the 2550onetomany branch August 9, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants