@viamrobotics/test-widgets 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/components/api-section.svelte +58 -50
  2. package/dist/components/api-section.svelte.d.ts +24 -11
  3. package/dist/components/content-rect.svelte +6 -0
  4. package/dist/components/content-rect.svelte.d.ts +1 -0
  5. package/dist/components/error.svelte +9 -0
  6. package/dist/components/error.svelte.d.ts +6 -0
  7. package/dist/components/index.d.ts +4 -2
  8. package/dist/components/index.js +4 -2
  9. package/dist/components/is-moving.svelte +26 -34
  10. package/dist/components/is-moving.svelte.d.ts +4 -5
  11. package/dist/components/progress.svelte +1 -0
  12. package/dist/components/queries.svelte +7 -0
  13. package/dist/components/queries.svelte.d.ts +4 -0
  14. package/dist/components/query.svelte +7 -0
  15. package/dist/components/query.svelte.d.ts +4 -0
  16. package/dist/components/section/index.d.ts +2 -0
  17. package/dist/components/section/index.js +2 -0
  18. package/dist/components/section/section-error-reporter.d.ts +8 -0
  19. package/dist/components/section/section-error-reporter.js +7 -0
  20. package/dist/components/section/section-error.svelte +36 -0
  21. package/dist/components/section/section-error.svelte.d.ts +9 -0
  22. package/dist/components/section/section-errors.svelte +132 -5
  23. package/dist/components/section/section.svelte +7 -1
  24. package/dist/components/section/section.svelte.d.ts +3 -0
  25. package/dist/components/section/use-section-errors.svelte.d.ts +1 -0
  26. package/dist/components/section/use-section-errors.svelte.js +11 -1
  27. package/dist/components/stop-button.svelte +1 -5
  28. package/dist/components/stop-button.svelte.d.ts +0 -1
  29. package/dist/components/stop.svelte +2 -2
  30. package/dist/components/widgets/arm/arm.svelte +24 -32
  31. package/dist/components/widgets/arm/get-joint-positions-widget.svelte +9 -8
  32. package/dist/components/widgets/arm/manual-mode-widget.svelte +13 -4
  33. package/dist/components/widgets/arm/manual-mode.svelte +1 -5
  34. package/dist/components/widgets/arm/manual-mode.svelte.d.ts +0 -1
  35. package/dist/components/widgets/arm/move-to-joint-positions-widget.svelte +10 -4
  36. package/dist/components/widgets/arm/move-to-joint-positions.svelte +1 -11
  37. package/dist/components/widgets/arm/move-to-joint-positions.svelte.d.ts +0 -1
  38. package/dist/components/widgets/arm/move-to-position-control.svelte +22 -18
  39. package/dist/components/widgets/arm/move-to-position.svelte +0 -4
  40. package/dist/components/widgets/arm/move-to-position.svelte.d.ts +0 -1
  41. package/dist/components/widgets/arm/quick-move-widget.svelte +10 -4
  42. package/dist/components/widgets/arm/quick-move.svelte +1 -4
  43. package/dist/components/widgets/arm/quick-move.svelte.d.ts +0 -1
  44. package/dist/components/widgets/audio-input/audio-input.svelte +76 -74
  45. package/dist/components/widgets/audio-input/get-properties-widget.svelte +15 -15
  46. package/dist/components/widgets/audio-output/audio-output.svelte +83 -81
  47. package/dist/components/widgets/audio-output/get-properties-widget.svelte +15 -15
  48. package/dist/components/widgets/base/base.svelte +70 -37
  49. package/dist/components/widgets/base/move-straight-widget.svelte +16 -4
  50. package/dist/components/widgets/base/quick-move-widget.svelte +25 -9
  51. package/dist/components/widgets/base/set-power-widget.svelte +20 -8
  52. package/dist/components/widgets/base/set-velocity-widget.svelte +20 -8
  53. package/dist/components/widgets/base/spin-widget.svelte +20 -8
  54. package/dist/components/widgets/board/read-write-pins.svelte +2 -2
  55. package/dist/components/widgets/button/push.svelte +2 -2
  56. package/dist/components/widgets/camera/camera.svelte +15 -23
  57. package/dist/components/widgets/camera/live-or-polling-video.svelte +12 -9
  58. package/dist/components/widgets/custom-control/__tests__/__fixtures__/with-sibling.svelte +10 -0
  59. package/dist/components/widgets/custom-control/control-frame.svelte +60 -0
  60. package/dist/components/widgets/custom-control/control-frame.svelte.d.ts +10 -0
  61. package/dist/components/widgets/custom-control/create-control-host.svelte.d.ts +19 -0
  62. package/dist/components/widgets/custom-control/create-control-host.svelte.js +26 -0
  63. package/dist/components/widgets/custom-control/custom-control.d.ts +35 -0
  64. package/dist/components/widgets/custom-control/custom-control.js +85 -0
  65. package/dist/components/widgets/custom-control/custom-control.svelte +45 -0
  66. package/dist/components/widgets/custom-control/custom-control.svelte.d.ts +14 -0
  67. package/dist/components/widgets/discovery/discovery.svelte +10 -15
  68. package/dist/components/widgets/encoder/encoder.svelte +20 -18
  69. package/dist/components/widgets/encoder/get-position-widget.svelte +18 -15
  70. package/dist/components/widgets/gantry/gantry.svelte +50 -74
  71. package/dist/components/widgets/gantry/get-position-widget.svelte +14 -13
  72. package/dist/components/widgets/gantry/home.svelte +21 -10
  73. package/dist/components/widgets/gantry/move-to-position-widget.svelte +2 -1
  74. package/dist/components/widgets/gantry/move-to-position.svelte +1 -4
  75. package/dist/components/widgets/gantry/move-to-position.svelte.d.ts +0 -1
  76. package/dist/components/widgets/gantry/quick-move-widget.svelte +2 -1
  77. package/dist/components/widgets/gantry/quick-move.svelte +1 -5
  78. package/dist/components/widgets/gantry/quick-move.svelte.d.ts +0 -1
  79. package/dist/components/widgets/generic/generic.svelte +7 -5
  80. package/dist/components/widgets/gripper/grab-widget.svelte +26 -0
  81. package/dist/components/widgets/gripper/grab-widget.svelte.d.ts +7 -0
  82. package/dist/components/widgets/gripper/grab.svelte +3 -19
  83. package/dist/components/widgets/gripper/grab.svelte.d.ts +1 -2
  84. package/dist/components/widgets/gripper/gripper.svelte +10 -12
  85. package/dist/components/widgets/gripper/is-holding-something.svelte +18 -19
  86. package/dist/components/widgets/gripper/open-widget.svelte +26 -0
  87. package/dist/components/widgets/gripper/open-widget.svelte.d.ts +7 -0
  88. package/dist/components/widgets/gripper/open.svelte +3 -19
  89. package/dist/components/widgets/gripper/open.svelte.d.ts +1 -2
  90. package/dist/components/widgets/input-controller/input-controller.svelte +7 -14
  91. package/dist/components/widgets/input-controller/webgamepad.svelte +2 -2
  92. package/dist/components/widgets/motion/motion.svelte +27 -35
  93. package/dist/components/widgets/motion/move-widget.svelte +32 -12
  94. package/dist/components/widgets/motion/move-widget.svelte.d.ts +6 -0
  95. package/dist/components/widgets/motion/move.svelte +1 -13
  96. package/dist/components/widgets/motion/move.svelte.d.ts +0 -1
  97. package/dist/components/widgets/motor/go-for-view.svelte +16 -8
  98. package/dist/components/widgets/motor/go-to-view.svelte +12 -4
  99. package/dist/components/widgets/motor/motor.svelte +88 -54
  100. package/dist/components/widgets/motor/quick-move-widget.svelte +16 -8
  101. package/dist/components/widgets/motor/set-power-widget.svelte +12 -4
  102. package/dist/components/widgets/motor/set-rpm-widget.svelte +12 -4
  103. package/dist/components/widgets/movement-sensor/get-accuracy-widget.svelte +7 -10
  104. package/dist/components/widgets/movement-sensor/get-compass-heading-widget.svelte +7 -10
  105. package/dist/components/widgets/movement-sensor/get-orientation-widget.svelte +7 -10
  106. package/dist/components/widgets/movement-sensor/get-position-widget.svelte +7 -10
  107. package/dist/components/widgets/movement-sensor/movement-sensor.svelte +55 -56
  108. package/dist/components/widgets/operations-and-sessions/operations-and-sessions.svelte +2 -1
  109. package/dist/components/widgets/power-sensor/get-current-widget.svelte +7 -10
  110. package/dist/components/widgets/power-sensor/get-power-widget.svelte +7 -10
  111. package/dist/components/widgets/power-sensor/get-voltage-widget.svelte +7 -10
  112. package/dist/components/widgets/power-sensor/power-sensor.svelte +26 -38
  113. package/dist/components/widgets/sensor/sensor.svelte +5 -10
  114. package/dist/components/widgets/servo/move-widget.svelte +2 -1
  115. package/dist/components/widgets/servo/move.svelte +1 -4
  116. package/dist/components/widgets/servo/move.svelte.d.ts +0 -1
  117. package/dist/components/widgets/servo/quick-move-widget.svelte +2 -1
  118. package/dist/components/widgets/servo/quick-move.svelte +1 -5
  119. package/dist/components/widgets/servo/quick-move.svelte.d.ts +0 -1
  120. package/dist/components/widgets/servo/servo.svelte +44 -33
  121. package/dist/components/widgets/slam/get-position-widget.svelte +7 -10
  122. package/dist/components/widgets/slam/move-on-map.svelte +6 -5
  123. package/dist/components/widgets/slam/move-on-map.svelte.d.ts +2 -1
  124. package/dist/components/widgets/slam/slam.svelte +64 -79
  125. package/dist/components/widgets/switch/position.svelte +2 -2
  126. package/package.json +3 -2
  127. package/dist/components/mutation-section.svelte +0 -75
  128. package/dist/components/mutation-section.svelte.d.ts +0 -18
  129. package/dist/components/mutation-view.svelte +0 -29
  130. package/dist/components/mutation-view.svelte.d.ts +0 -10
  131. package/dist/components/section-title.svelte +0 -65
  132. package/dist/components/section-title.svelte.d.ts +0 -15
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import CurrentReading from './current-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetCurrent"
27
+ queries={[query]}
28
+ method="GetCurrent"
29
+ api={ResourceTriplets.PowerSensor}
28
30
  class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- class="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <CurrentReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <CurrentReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import PowerReading from './power-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetPower"
27
+ queries={[query]}
28
+ method="GetPower"
29
+ api={ResourceTriplets.PowerSensor}
28
30
  class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- class="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <PowerReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <PowerReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import VoltageReading from './voltage-reading.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetVoltage"
27
+ queries={[query]}
28
+ method="GetVoltage"
29
+ api={ResourceTriplets.PowerSensor}
28
30
  class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- class="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <VoltageReading data={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <VoltageReading data={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -6,10 +6,10 @@
6
6
 
7
7
  import ApiSection from '../../api-section.svelte'
8
8
  import ConnectionStatus from '../../connection-status.svelte'
9
- import Query from '../../query.svelte'
10
9
  import ReadingsList from '../../readings-list.svelte'
11
10
  import RefetchController from '../../refetch-controller.svelte'
12
11
  import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
12
+ import { Section } from '../../section'
13
13
  import { ResourceTriplets } from '../../../resource-triplet'
14
14
 
15
15
  import CurrentReading from './current-reading.svelte'
@@ -67,56 +67,49 @@
67
67
  <div class="@container">
68
68
  <div class="grid w-full grid-cols-1 divide-y @2xl:grid-cols-3 @2xl:divide-x @2xl:divide-y-0">
69
69
  <ApiSection
70
- title="GetCurrent"
70
+ queries={[currentQuery]}
71
+ method="GetCurrent"
71
72
  api={ResourceTriplets.PowerSensor}
72
73
  class="grow flex-col gap-4 pb-5"
73
74
  >
74
- <Query
75
- query={currentQuery}
76
- class="h-6"
77
- >
78
- {#if currentQuery.data !== undefined}
79
- <CurrentReading data={currentQuery.data} />
80
- {/if}
81
- </Query>
75
+ {#if currentQuery.data !== undefined}
76
+ <CurrentReading data={currentQuery.data} />
77
+ {/if}
82
78
  </ApiSection>
83
79
  <ApiSection
84
- title="GetVoltage"
80
+ queries={[voltageQuery]}
81
+ method="GetVoltage"
85
82
  api={ResourceTriplets.PowerSensor}
86
83
  class="grow flex-col gap-4 pb-5"
87
84
  >
88
- <Query
89
- query={voltageQuery}
90
- class="h-6"
91
- >
92
- {#if voltageQuery.data !== undefined}
93
- <VoltageReading data={voltageQuery.data} />
94
- {/if}
95
- </Query>
85
+ {#if voltageQuery.data !== undefined}
86
+ <VoltageReading data={voltageQuery.data} />
87
+ {/if}
96
88
  </ApiSection>
97
89
  <ApiSection
98
- title="GetPower"
90
+ queries={[powerQuery]}
91
+ method="GetPower"
99
92
  api={ResourceTriplets.PowerSensor}
100
93
  class="grow flex-col gap-4 pb-5"
101
94
  >
102
- <Query
103
- query={powerQuery}
104
- class="h-6"
105
- >
106
- {#if powerQuery.data !== undefined}
107
- <PowerReading data={powerQuery.data} />
108
- {/if}
109
- </Query>
95
+ {#if powerQuery.data !== undefined}
96
+ <PowerReading data={powerQuery.data} />
97
+ {/if}
110
98
  </ApiSection>
111
99
  </div>
112
100
  </div>
113
101
 
114
102
  <ApiSection
103
+ queries={[readingsQuery]}
115
104
  class="grow flex-col gap-4"
116
- title="GetReadings"
105
+ method="GetReadings"
117
106
  api={ResourceTriplets.PowerSensor}
118
- description="Get all the measurements and data that this power sensor provides"
119
107
  >
108
+ {#snippet subheading()}
109
+ <Section.Text>
110
+ Get all the measurements and data that this power sensor provides
111
+ </Section.Text>
112
+ {/snippet}
120
113
  <Switch
121
114
  bind:on={isGetReadingsEnabled}
122
115
  cx="text-subtle-2"
@@ -127,14 +120,9 @@
127
120
  transition:slide={{ duration: 150 }}
128
121
  class="pt-2"
129
122
  >
130
- <Query
131
- query={readingsQuery}
132
- class="h-6"
133
- >
134
- {#if readingsQuery.data !== undefined}
135
- <ReadingsList data={readingsQuery.data} />
136
- {/if}
137
- </Query>
123
+ {#if readingsQuery.data !== undefined}
124
+ <ReadingsList data={readingsQuery.data} />
125
+ {/if}
138
126
  </div>
139
127
  {/if}
140
128
  </ApiSection>
@@ -4,7 +4,6 @@
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
6
  import ConnectionStatus from '../../connection-status.svelte'
7
- import Query from '../../query.svelte'
8
7
  import ReadingsList from '../../readings-list.svelte'
9
8
  import RefetchController from '../../refetch-controller.svelte'
10
9
  import { createRefetchIntervalStore } from '../../refetch-interval-store.svelte'
@@ -44,18 +43,14 @@
44
43
  </div>
45
44
 
46
45
  <ApiSection
47
- title="GetReadings"
46
+ queries={[readingsQuery]}
47
+ method="GetReadings"
48
48
  api={ResourceTriplets.Sensor}
49
49
  class="relative grow flex-col gap-4"
50
50
  >
51
- <Query
52
- query={readingsQuery}
53
- class="h-6"
54
- >
55
- {#if readingsQuery.data !== undefined}
56
- <ReadingsList data={readingsQuery.data} />
57
- {/if}
58
- </Query>
51
+ {#if readingsQuery.data !== undefined}
52
+ <ReadingsList data={readingsQuery.data} />
53
+ {/if}
59
54
  </ApiSection>
60
55
  {/snippet}
61
56
  </ConnectionStatus>
@@ -7,6 +7,7 @@
7
7
  } from '@viamrobotics/svelte-sdk'
8
8
 
9
9
  import Query from '../../query.svelte'
10
+ import { Section } from '../../section'
10
11
 
11
12
  import Move from './move.svelte'
12
13
 
@@ -38,7 +39,7 @@
38
39
  <Move
39
40
  currentPosition={positionQuery.data}
40
41
  {moveTo}
41
- lastError={moveMutation.error}
42
42
  />
43
43
  {/if}
44
44
  </Query>
45
+ <Section.Error error={moveMutation.error} />
@@ -1,16 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { Button, Icon, Label, NumericInput, Tooltip } from '@viamrobotics/prime-core'
3
3
 
4
- import ErrorDisplay from '../../error.svelte'
5
4
  import { numberValueFromEvent } from '../../../event-handlers'
6
5
 
7
6
  interface Props {
8
7
  currentPosition: number
9
8
  moveTo: (angle: number) => void
10
- lastError: Error | null
11
9
  }
12
10
 
13
- const { currentPosition, moveTo, lastError }: Props = $props()
11
+ const { currentPosition, moveTo }: Props = $props()
14
12
 
15
13
  let desiredAngle = $state(0)
16
14
 
@@ -99,4 +97,3 @@
99
97
  Execute
100
98
  </Button>
101
99
  </div>
102
- <ErrorDisplay {lastError} />
@@ -1,7 +1,6 @@
1
1
  interface Props {
2
2
  currentPosition: number;
3
3
  moveTo: (angle: number) => void;
4
- lastError: Error | null;
5
4
  }
6
5
  declare const Move: import("svelte").Component<Props, {}, "">;
7
6
  type Move = ReturnType<typeof Move>;
@@ -7,6 +7,7 @@
7
7
  } from '@viamrobotics/svelte-sdk'
8
8
 
9
9
  import Query from '../../query.svelte'
10
+ import { Section } from '../../section'
10
11
 
11
12
  import QuickMove from './quick-move.svelte'
12
13
 
@@ -38,7 +39,7 @@
38
39
  <QuickMove
39
40
  currentPosition={positionQuery.data}
40
41
  moveTo={quickMoveTo}
41
- lastError={quickMoveMutation.error}
42
42
  />
43
43
  {/if}
44
44
  </Query>
45
+ <Section.Error error={quickMoveMutation.error} />
@@ -1,15 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { Button } from '@viamrobotics/prime-core'
3
3
 
4
- import ErrorDisplay from '../../error.svelte'
5
-
6
4
  interface Props {
7
5
  currentPosition: number
8
6
  moveTo: (angle: number) => void
9
- lastError: Error | null
10
7
  }
11
8
 
12
- const { currentPosition, moveTo, lastError }: Props = $props()
9
+ const { currentPosition, moveTo }: Props = $props()
13
10
  </script>
14
11
 
15
12
  <div class="flex flex-row gap-4 text-xs">
@@ -31,4 +28,3 @@
31
28
  <abbr class="text-subtle-2">º</abbr>
32
29
  </Button>
33
30
  </div>
34
- <ErrorDisplay {lastError} />
@@ -1,7 +1,6 @@
1
1
  interface Props {
2
2
  currentPosition: number;
3
3
  moveTo: (angle: number) => void;
4
- lastError: Error | null;
5
4
  }
6
5
  declare const QuickMove: import("svelte").Component<Props, {}, "">;
7
6
  type QuickMove = ReturnType<typeof QuickMove>;
@@ -9,7 +9,8 @@
9
9
  import ApiSection from '../../api-section.svelte'
10
10
  import ConnectionStatus from '../../connection-status.svelte'
11
11
  import IsMoving from '../../is-moving.svelte'
12
- import Query from '../../query.svelte'
12
+ import { Section } from '../../section'
13
+ import { useSectionErrors } from '../../section/use-section-errors.svelte'
13
14
  import StopButton from '../../stop-button.svelte'
14
15
  import { formatNumeric } from '../../../format'
15
16
  import { ResourceTriplets } from '../../../resource-triplet'
@@ -38,6 +39,11 @@
38
39
  const quickMoveMutation = createResourceMutation(client, 'move')
39
40
  const stopMutation = createResourceMutation(client, 'stop')
40
41
 
42
+ const quickMoveErrors = useSectionErrors(() => ({
43
+ queries: [positionQuery],
44
+ mutations: [quickMoveMutation],
45
+ }))
46
+
41
47
  const moveTo = (angle: number) => {
42
48
  moveMutation.mutate([angle], {})
43
49
  }
@@ -55,62 +61,67 @@
55
61
  <div class="grid grid-cols-1 divide-y @2xl:grid-cols-3 @2xl:divide-x @2xl:divide-y-0">
56
62
  <ApiSection
57
63
  class="grow flex-col gap-4"
58
- title="GetPosition"
64
+ method="GetPosition"
59
65
  api={ResourceTriplets.Servo}
60
- bottomText="Updates automatically"
66
+ queries={[positionQuery]}
61
67
  >
62
- <Query query={positionQuery}>
63
- {#if positionQuery.data !== undefined}
64
- <!-- span required to get unit closer to position reading -->
65
- <span class="flex flex-row gap-1">
66
- <span class="font-roboto-mono font-normal"
67
- >{formatNumeric(positionQuery.data)}</span
68
- >
69
- <abbr class="text-subtle-2">º</abbr>
70
- </span>
71
- {/if}
72
- </Query>
68
+ {#if positionQuery.data !== undefined}
69
+ <!-- span required to get unit closer to position reading -->
70
+ <span class="flex flex-row gap-1">
71
+ <span class="font-roboto-mono font-normal"
72
+ >{formatNumeric(positionQuery.data)}</span
73
+ >
74
+ <abbr class="text-subtle-2">º</abbr>
75
+ </span>
76
+ {/if}
77
+ <Section.Text class="mt-auto">Updates automatically</Section.Text>
73
78
  </ApiSection>
74
79
  <ApiSection
75
80
  class="grow flex-col gap-4"
76
- title="Move"
81
+ method="Move"
77
82
  api={ResourceTriplets.Servo}
83
+ queries={[positionQuery]}
84
+ mutations={[moveMutation]}
78
85
  >
79
- <Query query={positionQuery}>
80
- {#if positionQuery.data !== undefined}
81
- <Move
82
- currentPosition={positionQuery.data}
83
- {moveTo}
84
- lastError={moveMutation.error}
85
- />
86
- {/if}
87
- </Query>
86
+ {#if positionQuery.data !== undefined}
87
+ <Move
88
+ currentPosition={positionQuery.data}
89
+ {moveTo}
90
+ />
91
+ {/if}
88
92
  </ApiSection>
89
- <ApiSection
93
+ <Section
94
+ errorReporter={quickMoveErrors}
90
95
  class="grow flex-col gap-4"
91
- title="Quick move"
92
- bottomText="Press a button to execute"
93
96
  >
94
- <Query query={positionQuery}>
97
+ <div class="flex flex-col gap-0.5">
98
+ <Section.Heading>
99
+ Quick move
100
+ {#snippet aside()}
101
+ <Section.Errors errors={quickMoveErrors.errors} />
102
+ {/snippet}
103
+ </Section.Heading>
104
+ </div>
105
+ <Section.Body isLoading={quickMoveErrors.isLoading}>
95
106
  {#if positionQuery.data !== undefined}
96
107
  <QuickMove
97
108
  currentPosition={positionQuery.data}
98
109
  moveTo={quickMoveTo}
99
- lastError={quickMoveMutation.error}
100
110
  />
101
111
  {/if}
102
- </Query>
103
- </ApiSection>
112
+ <Section.Text class="mt-auto">Press a button to execute</Section.Text>
113
+ </Section.Body>
114
+ </Section>
104
115
  </div>
105
116
  </div>
106
117
  <div class="flex flex-col divide-y @4xl:ml-auto @4xl:w-full @4xl:max-w-40">
107
118
  <ApiSection
108
119
  class="grow flex-col gap-4"
109
- title="Stop"
120
+ method="Stop"
110
121
  api={ResourceTriplets.Servo}
122
+ mutations={[stopMutation]}
111
123
  >
112
124
  <StopButton
113
- error={stopMutation.error}
114
125
  onStop={() => {
115
126
  stopMutation.mutate([])
116
127
  }}
@@ -3,7 +3,7 @@
3
3
  import { createResourceClient, createResourceQuery } from '@viamrobotics/svelte-sdk'
4
4
 
5
5
  import ApiSection from '../../api-section.svelte'
6
- import Query from '../../query.svelte'
6
+ import { ResourceTriplets } from '../../../resource-triplet'
7
7
 
8
8
  import Position from './position.svelte'
9
9
 
@@ -24,15 +24,12 @@
24
24
  </script>
25
25
 
26
26
  <ApiSection
27
- title="GetPosition"
27
+ method="GetPosition"
28
+ api={ResourceTriplets.Slam}
29
+ queries={[query]}
28
30
  class="grow flex-col gap-4"
29
31
  >
30
- <Query
31
- {query}
32
- class="h-6"
33
- >
34
- {#if query.data !== undefined}
35
- <Position position={query.data} />
36
- {/if}
37
- </Query>
32
+ {#if query.data !== undefined}
33
+ <Position position={query.data} />
34
+ {/if}
38
35
  </ApiSection>
@@ -1,8 +1,9 @@
1
1
  <script lang="ts">
2
2
  import { Button, Label, NumericInput } from '@viamrobotics/prime-core'
3
3
 
4
+ import type { SectionMutation } from '../../section/use-section-errors.svelte'
5
+
4
6
  import ApiSection from '../../api-section.svelte'
5
- import ErrorDisplay from '../../error.svelte'
6
7
  import { numberValueFromEvent } from '../../../event-handlers'
7
8
  import { ResourceTriplets } from '../../../resource-triplet'
8
9
 
@@ -13,10 +14,10 @@
13
14
  updateDestination: (_: Partial<PosePosition>) => void
14
15
  moveOnMap: (planDeviationM: number | undefined) => void
15
16
  stopPlan: () => void
16
- lastError: Error | null
17
+ mutations: SectionMutation[]
17
18
  }
18
19
 
19
- const { destination, updateDestination, moveOnMap, stopPlan, lastError }: Props = $props()
20
+ const { destination, updateDestination, moveOnMap, stopPlan, mutations }: Props = $props()
20
21
 
21
22
  const destinationID = $props.id()
22
23
 
@@ -25,8 +26,9 @@
25
26
 
26
27
  <ApiSection
27
28
  class="grow flex-col gap-4"
28
- title="MoveOnMap"
29
+ method="MoveOnMap"
29
30
  api={ResourceTriplets.Motion}
31
+ {mutations}
30
32
  >
31
33
  <Label>
32
34
  Plan deviation <abbr>(m)</abbr>
@@ -102,5 +104,4 @@
102
104
  Stop
103
105
  </Button>
104
106
  </div>
105
- <ErrorDisplay {lastError} />
106
107
  </ApiSection>
@@ -1,10 +1,11 @@
1
+ import type { SectionMutation } from '../../section/use-section-errors.svelte';
1
2
  import type { PosePosition } from './pose';
2
3
  interface Props {
3
4
  destination: PosePosition | undefined;
4
5
  updateDestination: (_: Partial<PosePosition>) => void;
5
6
  moveOnMap: (planDeviationM: number | undefined) => void;
6
7
  stopPlan: () => void;
7
- lastError: Error | null;
8
+ mutations: SectionMutation[];
8
9
  }
9
10
  declare const MoveOnMap: import("svelte").Component<Props, {}, "">;
10
11
  type MoveOnMap = ReturnType<typeof MoveOnMap>;