feat(web): Link to Bot Details#57210
Conversation
# Conflicts: # web/packages/teleport/src/Bots/Details/BotDetails.story.tsx # web/packages/teleport/src/Bots/Details/BotDetails.tsx # web/packages/teleport/src/Bots/Details/Instance.story.tsx # web/packages/teleport/src/Bots/Details/Instance.tsx # web/packages/teleport/src/Bots/Details/InstancesPanel.story.tsx # web/packages/teleport/src/Bots/Details/InstancesPanel.tsx # web/packages/teleport/src/Bots/Details/JoinMethodIcon.tsx # web/packages/teleport/src/test/helpers/tokens.ts # web/packages/teleport/src/useClusterVersion.ts
| // If location.key is unset, or 'default', this is the first history entry in-app in the session. | ||
| if (!location.key || location.key === 'default') { | ||
| history.push(cfg.getBotsRoute()); | ||
| } else { | ||
| history.goBack(); | ||
| } |
There was a problem hiding this comment.
i thought this meant, if there were no history, then push a history, otherwise go back to previous route in the app, but this seems to always default back to the bots list route
also i was just curious, i saw a similar code earlier and it was wrapped in useCallback but not here?
There was a problem hiding this comment.
I grabbed this snippet from AccessList. Doesn't appear to be done anywhere else within a useCallback.
It seems to be working as I would expect. Are you suggesting it should replace instead of push when navigating back without history?
| }) { | ||
| const { id, version, hostname, activeAt, method, os } = props; | ||
|
|
||
| const hasHeartbeatData = !!version || !!hostname || !!method || !!os; |
There was a problem hiding this comment.
is this b/c of backwards compat? if so, should we say they need to upgrade? (sorry if im way off)
There was a problem hiding this comment.
Technically, an instance may not have or failed to send an initial heartbeat (therefore no heartbeat data is available). In reality, this doesn't happen.
| flex={1} | ||
| gap={2} | ||
| justifyContent="space-between" | ||
| overflow={'hidden'} |
There was a problem hiding this comment.
What's the role of the overflow here? I thought it's already handled in the bot name container and labels container separately. Also: You can just write overflow="hidden".
|
|
||
| {hostname ? ( | ||
| <HoverTooltip placement="top" tipContent={'Hostname'}> | ||
| <SecondaryOutlined borderRadius={2}> |
There was a problem hiding this comment.
These things proliferate, and this page alone already has two variants of it ("round" and "less round"). We have these Label and Pill components, but they aged (like milk, not like wine) and since they don't really support the new designs, they are not reused. There's also the new Chips spec, but not yet ready for implementation.
I'm not asking you to fix it here (it needs to be a separate effort), but I'd just like to bring this UI to attention of @rishibarbhaya-design and @roraback as what is possibly the most extensive use of the chip pattern and one of the places that could really benefit from having these unified and implemented as a part of our design library.
One thing I would consider, though, is to get to agreement with the UX team about what are the guidelines about using the round and semi-round chips here, as I don't see the semi-round variant in the new designs.
There was a problem hiding this comment.
Agreed - it's a bit of a mess.
I didn't want to implement the Chips spec as a part of these changes, and tweaking the Label component was the easiest way to achieve the visual style.
@samratambadekar, correct me if I'm wrong, but the elements used by Bot Instance items for version and hostname are separate in design from Chips. Again, I've reused the Label component with slightly less rounded corners.
|
|
||
| function sizetoInnerPx(size: IconProps['size']) { | ||
| if (size === 'small') return '12px'; | ||
| function sizetoPx(size: IconProps['size']) { |
There was a problem hiding this comment.
This function mirrors a part of the logic that belongs to the inside of the Icon component, so consider extracting it to a separate common function. Secondly, since we started using IconProps to define sizes of ResourceIcon, it may be a better idea to port the concept of an icon size enum to the ResourceIcon component itself and handle it there, with IconProps['size'] extracted as a separate type, perhaps common to both IconandResourceIcon`.
There was a problem hiding this comment.
I've moved this mapping to ResourceIcon. It's slightly different to the mapping in Icon to account for there being no in-asset padding for resource icons as there is for regular icons.
I've added an optional size prop to ResourceIcon and reused IconTypes['size'] without moving the type.
|
@nicholasmarais1158 See the table below for backport results.
|
* RPC and cache * API * Update rfc0217 * Remove unnecessary copy * Fix import ordering * Fix cache bypass issue * Add context to unmarshal error * Wrap page_size parse error * Keep backend range logic consistent * feat(web): Add Join Tokens panel to Bot Details * Copy correction * Remove unneeded alert action * Handle outdated proxy error * Extend tests * Rename * Use `tokens.list` for access to tokens page (instead of `tokens.create`) * Add outline label variants * Add `semver` dep to teleport package * Add `useClusterVersion` hook * Expose heartbeat OS * Add sorting icons * Add `JoinMethodIcon` component * Add bot instances to Bot Details * Missing lock content * Fix scroll container * Scroll to top on sort * Remove unused import * Extract join method icons to component * Add mission join token icons/logos * Use OS logos (update windows) * Save some lines 😮💨 * Unused imports * Use shared semver * Fix exhaustive check * Re-export new Label variants * Correct version compatibility logic and messaging * Improve error state UX * Use `H2` * Reduce lines * Reduce lines (more) * Fix tests and lint * Fix grid alignment * Remove unnecessary margin 0 * Clarify roles container * Improve type safety of sort state * Remove unnecessary wrappers * Improve `useClusterVersion` * Add sorting icons (used later) * Bot details nav and edit from list * Add up/back navigation * Make icons bigger * Make label text bigger * Add "No heartbeat data" state * Rename `check()` * Correct newer version messaging * Tweak Label component border radius * Spacing, sizing and overflow handling * Add overflow stories * Fix typing * Remove old edit form * Remove fixme comment * Fix lint * Remove redundant memoization * Tidy text styles * Add `style` prop to ResourceIcon
* RPC and cache * API * Update rfc0217 * Remove unnecessary copy * Fix import ordering * Fix cache bypass issue * Add context to unmarshal error * Wrap page_size parse error * Keep backend range logic consistent * feat(web): Add Join Tokens panel to Bot Details * Copy correction * Remove unneeded alert action * Handle outdated proxy error * Extend tests * Rename * Use `tokens.list` for access to tokens page (instead of `tokens.create`) * Add outline label variants * Add `semver` dep to teleport package * Add `useClusterVersion` hook * Expose heartbeat OS * Add sorting icons * Add `JoinMethodIcon` component * Add bot instances to Bot Details * Missing lock content * Fix scroll container * Scroll to top on sort * Remove unused import * Extract join method icons to component * Add mission join token icons/logos * Use OS logos (update windows) * Save some lines 😮💨 * Unused imports * Use shared semver * Fix exhaustive check * Re-export new Label variants * Correct version compatibility logic and messaging * Improve error state UX * Use `H2` * Reduce lines * Reduce lines (more) * Fix tests and lint * Fix grid alignment * Remove unnecessary margin 0 * Clarify roles container * Improve type safety of sort state * Remove unnecessary wrappers * Improve `useClusterVersion` * Add sorting icons (used later) * Bot details nav and edit from list * Add up/back navigation * Make icons bigger * Make label text bigger * Add "No heartbeat data" state * Rename `check()` * Correct newer version messaging * Tweak Label component border radius * Spacing, sizing and overflow handling * Add overflow stories * Fix typing * Remove old edit form * Remove fixme comment * Fix lint * Remove redundant memoization * Tidy text styles * Add `style` prop to ResourceIcon
* feat(web): Link to Bot Details (#57210) * RPC and cache * API * Update rfc0217 * Remove unnecessary copy * Fix import ordering * Fix cache bypass issue * Add context to unmarshal error * Wrap page_size parse error * Keep backend range logic consistent * feat(web): Add Join Tokens panel to Bot Details * Copy correction * Remove unneeded alert action * Handle outdated proxy error * Extend tests * Rename * Use `tokens.list` for access to tokens page (instead of `tokens.create`) * Add outline label variants * Add `semver` dep to teleport package * Add `useClusterVersion` hook * Expose heartbeat OS * Add sorting icons * Add `JoinMethodIcon` component * Add bot instances to Bot Details * Missing lock content * Fix scroll container * Scroll to top on sort * Remove unused import * Extract join method icons to component * Add mission join token icons/logos * Use OS logos (update windows) * Save some lines 😮💨 * Unused imports * Use shared semver * Fix exhaustive check * Re-export new Label variants * Correct version compatibility logic and messaging * Improve error state UX * Use `H2` * Reduce lines * Reduce lines (more) * Fix tests and lint * Fix grid alignment * Remove unnecessary margin 0 * Clarify roles container * Improve type safety of sort state * Remove unnecessary wrappers * Improve `useClusterVersion` * Add sorting icons (used later) * Bot details nav and edit from list * Add up/back navigation * Make icons bigger * Make label text bigger * Add "No heartbeat data" state * Rename `check()` * Correct newer version messaging * Tweak Label component border radius * Spacing, sizing and overflow handling * Add overflow stories * Fix typing * Remove old edit form * Remove fixme comment * Fix lint * Remove redundant memoization * Tidy text styles * Add `style` prop to ResourceIcon * fix(web): Bot details instance spacing (#57563) * Add padded container to `ResourceIcon` * Increase join method and os icon size * Include value in hostname tooltip * Improve version and hostname spacing * Tidy hostname height * Lower heading weight * Revert title weight back to bold * Fix warning label text colour * Unused imports 😞 * Add Oracle icon and `pnpm process-icons` * fix(web): Oracle brand icon (#57708) * fix(web): Oracle brand icon * Run `pnpm process-icons`
* feat(web): Link to Bot Details (#57210) * RPC and cache * API * Update rfc0217 * Remove unnecessary copy * Fix import ordering * Fix cache bypass issue * Add context to unmarshal error * Wrap page_size parse error * Keep backend range logic consistent * feat(web): Add Join Tokens panel to Bot Details * Copy correction * Remove unneeded alert action * Handle outdated proxy error * Extend tests * Rename * Use `tokens.list` for access to tokens page (instead of `tokens.create`) * Add outline label variants * Add `semver` dep to teleport package * Add `useClusterVersion` hook * Expose heartbeat OS * Add sorting icons * Add `JoinMethodIcon` component * Add bot instances to Bot Details * Missing lock content * Fix scroll container * Scroll to top on sort * Remove unused import * Extract join method icons to component * Add mission join token icons/logos * Use OS logos (update windows) * Save some lines 😮💨 * Unused imports * Use shared semver * Fix exhaustive check * Re-export new Label variants * Correct version compatibility logic and messaging * Improve error state UX * Use `H2` * Reduce lines * Reduce lines (more) * Fix tests and lint * Fix grid alignment * Remove unnecessary margin 0 * Clarify roles container * Improve type safety of sort state * Remove unnecessary wrappers * Improve `useClusterVersion` * Add sorting icons (used later) * Bot details nav and edit from list * Add up/back navigation * Make icons bigger * Make label text bigger * Add "No heartbeat data" state * Rename `check()` * Correct newer version messaging * Tweak Label component border radius * Spacing, sizing and overflow handling * Add overflow stories * Fix typing * Remove old edit form * Remove fixme comment * Fix lint * Remove redundant memoization * Tidy text styles * Add `style` prop to ResourceIcon * fix(web): Bot details instance spacing (#57563) * Add padded container to `ResourceIcon` * Increase join method and os icon size * Include value in hostname tooltip * Improve version and hostname spacing * Tidy hostname height * Lower heading weight * Revert title weight back to bold * Fix warning label text colour * Unused imports 😞 * Add Oracle icon and `pnpm process-icons` * fix(web): Oracle brand icon (#57708) * fix(web): Oracle brand icon * Run `pnpm process-icons`

Summary
This change links the Bot Details page with the rest of the app by clicking a row on the Bots List. It also includes a number of UI/UX refinements to the Bot Details page as a result of a design review.
Changelog: Use the bot details page to view and edit bot configuration, and see active instances with their upgrade status.
Depends on: #57023
Designs: Figma link
RFD: RFD0217 - Bot Details (web)
Updates: #47342
Changes
Demo
Screen.Recording.2025-07-28.at.11.02.14.mov
Screenshots