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-3417: Add sample code to Create a Web App #4130

Merged
merged 4 commits into from
Mar 26, 2025

Conversation

JessamyT
Copy link
Collaborator

No description provided.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Mar 24, 2025
Copy link

netlify bot commented Mar 24, 2025

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit fa5fe4c
🔍 Latest deploy log https://app.netlify.com/sites/viam-docs/deploys/67e2f44a1bb5b800082484da
😎 Deploy Preview https://deploy-preview-4130--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 20 (🔴 down 24 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -36,6 +36,222 @@ Refer to the [Viam TypeScript SDK](https://ts.viam.dev/) documentation for avail

### Example usage

{{< expand "Example camera and sensor code" >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this should be in an expander. It's too easy to miss

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like how the Flutter app page works for that better


{{<imgproc src="/operate/ts-dashboard.png" resize="x1100" declaredimensions=true alt="A web browser displaying a dashboard with a camera feed and sensor readings." style="max-width:500px" class="imgzoom" >}}

<file>main.ts</file>:
Copy link
Collaborator

Choose a reason for hiding this comment

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

A common pattern with web dev is to put these three files in tabs. We could do that here to preserve space

Comment on lines 255 to 257
For an example using Vite to connect to a machine, see [Viam's vanilla TypeScript quickstart example on GitHub](https://github.com/viamrobotics/viam-typescript-sdk/tree/main/examples/vanilla).

The following tutorial uses the Viam TypeScript SDK to query data that has been uploaded to the Viam cloud from a sensor, and display it in a web dashboard.
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 looks a bit odd here. It takes up more space than the expander

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I take it out of the expander and have the code block that won't be the case...also I think this tutorial is pretty good at walking through the TS setup so I don't want to de-emphasize it too much. With the code block is that okay?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep

@JessamyT JessamyT requested a review from npentrel March 25, 2025 18:22
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.

LGTM. I do wonder if instead of displaying a single image it should show a live stream.

We do now have 2 of these pages feature examples that have the drive a rover in a square in it. And this one doesn't. We naturally don't have to stick with the driving a rover examples. I think it might in fact make sense to move away from it and using an example that aligns better with the use cases we've seen more of recently? What do you think?

@JessamyT
Copy link
Collaborator Author

JessamyT commented Mar 26, 2025

LGTM. I do wonder if instead of displaying a single image it should show a live stream.

We do now have 2 of these pages feature examples that have the drive a rover in a square in it. And this one doesn't. We naturally don't have to stick with the driving a rover examples. I think it might in fact make sense to move away from it and using an example that aligns better with the use cases we've seen more of recently? What do you think?

Yeah so this was an intentional move away from that and towards the use cases we're seeing. We've gotten AI Qs both about getting an image and getting a video stream, as well as getting sensor data, so I think either is fine. Maybe stream is more broadly useful though/is the more difficult case so I will merge this (to get AI Qs landing on it sooner rather than later) and make a quick follow-up to make it a stream. The air quality tute already shows querying data so I figured just directly getting data would be good for the simple example here.

For the headless app, I think people are slightly less likely to be looking for a camera stream, and we get fewer Qs about displaying a camera stream or querying sensor data with Go or C++ (or maybe even Python), so not important to change that example. For the mobile app, I will make a ticket to change it to something more like this but not going to prioritize that.

@JessamyT JessamyT merged commit b81478f into viamrobotics:main Mar 26, 2025
12 checks passed
@JessamyT JessamyT deleted the 3417webapp branch March 26, 2025 17:24
Copy link

🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs (https://docs.viam.com)'

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