-
Notifications
You must be signed in to change notification settings - Fork 61
feat: add Runtime read-only TUI #1802
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
2cd8593
feat: add Runtime TUI route menus
aidandaly24 b95036a
test: add controllable Runtime screen client
aidandaly24 410de77
test: focus Runtime test helper coverage
aidandaly24 2575049
feat: add Runtime TUI picker
aidandaly24 506fef3
test: stabilize screen resize synchronization
aidandaly24 95bd4c1
feat: add Runtime TUI hub and detail
aidandaly24 1a3bb94
feat: add Runtime version TUI
aidandaly24 79301bb
feat: add Runtime endpoint TUI
aidandaly24 801f608
feat: add explicit Runtime TUI entry
aidandaly24 739efc8
refactor: keep test IO options local
aidandaly24 6d34438
test: complete Runtime TUI coverage
aidandaly24 76cb020
test: verify Runtime TUI exit and filtering
aidandaly24 3028bbf
fix: stabilize Runtime pagination resets
aidandaly24 2735339
fix: keep TUI footer stable in narrow terminals
aidandaly24 5ec22d0
fix: clarify Runtime latest version column
aidandaly24 451c27d
fix: align Runtime TUI navigation with Harness
aidandaly24 e81653c
refactor: simplify Runtime TUI helpers
aidandaly24 dbbe455
fix: align Runtime TUI entry and detail output
aidandaly24 a25dd75
test: simplify Runtime TUI integration coverage
aidandaly24 6b7e4a2
refactor: share token-paged table picker
aidandaly24 b98fdac
fix: strip SDK metadata from Runtime output
aidandaly24 9f4bfa0
fix: support pasted table filters
aidandaly24 07bee92
test: stabilize Runtime TUI exit readiness
aidandaly24 35118b6
test: decouple Runtime exit readiness from rendering
aidandaly24 e44e5e4
refactor: align Runtime picker component placement
aidandaly24 06c39f0
test: replace fixed TUI delays with state waits
aidandaly24 97f175c
refactor: align Runtime route registration with Harness
aidandaly24 eaf3a2f
refactor: clarify Harness picker names
aidandaly24 b1f1dac
refactor: keep table filter copy generic
aidandaly24 0b36541
test: remove redundant DataTable copy test
aidandaly24 4fed8f0
refactor: separate table reset responsibilities
aidandaly24 70e8350
refactor: simplify key hint width calculation
aidandaly24 0b11c1f
test: consolidate runtime TUI coverage
aidandaly24 88834c4
refactor: simplify paged picker implementation
aidandaly24 8c9ec77
fix: preserve Winston dependencies after rebase
aidandaly24 0b46082
refactor: defer SDK metadata filtering
aidandaly24 432a397
docs: use TSDoc for Harness pickers
aidandaly24 4ffe40a
refactor: rename paginated table picker
aidandaly24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import { useNavigate } from "react-router"; | ||
| import type { HarnessEndpoint } from "@aws-sdk/client-bedrock-agentcore-control"; | ||
| import type { ScreenProps } from "../handlers/types"; | ||
| import { coreOptsFromCtx } from "../handlers/utils"; | ||
| import { PaginatedTablePicker } from "./PaginatedTablePicker"; | ||
|
|
||
| // EndpointRow is the flat, display-ready shape the table renders. | ||
| interface EndpointRow extends Record<string, unknown> { | ||
| endpointName: string; | ||
| liveVersion: string; | ||
| targetVersion: string; | ||
| status: string; | ||
| updatedAt: string; | ||
| } | ||
|
|
||
| function toRow(e: HarnessEndpoint): EndpointRow { | ||
| return { | ||
| endpointName: e.endpointName!, | ||
| liveVersion: e.liveVersion ?? "-", | ||
| targetVersion: e.targetVersion ?? "-", | ||
| status: e.status!, | ||
| updatedAt: e.updatedAt!.toISOString(), | ||
| }; | ||
| } | ||
|
|
||
| export interface HarnessEndpointPickerProps extends ScreenProps { | ||
| // harnessId scopes the listing to one harness's endpoints. | ||
| harnessId: string; | ||
| // breadcrumb labels the screen the picker is serving. | ||
| breadcrumb: string[]; | ||
| // description tells the user what selecting an endpoint will do. | ||
| description?: string; | ||
| // onSelect receives the chosen endpoint's name. | ||
| onSelect: (endpointName: string) => void; | ||
| // onEscape overrides what esc does (default: pop back in history). Hosts | ||
| // that embed the picker as an overlay (e.g. the chat's ctrl+t endpoint | ||
| // switch) pass a closer instead. | ||
| onEscape?: () => void; | ||
| } | ||
|
|
||
| /** | ||
| * Fetches a harness's endpoints and renders them as a navigable table. | ||
| * | ||
| * This is the endpoint counterpart of HarnessPicker, shared by every "pick an | ||
| * endpoint" screen (list, update, delete). Esc pops back. | ||
| */ | ||
| export function HarnessEndpointPicker({ | ||
| ctx, | ||
| core, | ||
| harnessId, | ||
| breadcrumb, | ||
| description, | ||
| onSelect, | ||
| onEscape, | ||
| }: HarnessEndpointPickerProps) { | ||
| const opts = coreOptsFromCtx(ctx); | ||
| const navigate = useNavigate(); | ||
| const goBack = onEscape ?? (() => navigate(-1)); | ||
|
|
||
| return ( | ||
| <PaginatedTablePicker | ||
| breadcrumb={breadcrumb} | ||
| description={description} | ||
| queryKey={["harness-endpoints", opts.region, harnessId]} | ||
| loadPage={async (token, pageSize) => { | ||
| const response = await core.harness.listHarnessEndpoints(harnessId, token, pageSize, opts); | ||
| return { | ||
| items: response.endpoints ?? [], | ||
| nextToken: response.nextToken, | ||
| }; | ||
| }} | ||
| toRow={toRow} | ||
| columns={[ | ||
| { key: "endpointName", header: "name" }, | ||
| { key: "liveVersion", header: "live" }, | ||
| { key: "targetVersion", header: "target" }, | ||
| { key: "status", header: "status" }, | ||
| { key: "updatedAt", header: "updatedAt" }, | ||
| ]} | ||
| getValue={(row) => row.endpointName} | ||
| onSelect={onSelect} | ||
| onBack={goBack} | ||
| loadingMessage="Loading endpoints…" | ||
| errorMessage={(error) => `Error: ${error.message}`} | ||
| emptyMessage="This harness has no endpoints yet." | ||
| emptyPageMessage={`No endpoints on this page for harness ${harnessId}.`} | ||
| /> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't be against sorting these into folders since I could picture this getting unwieldy as time goes on. The reason I held off was because I didn't know if maybe we just sort the primitive ones or if maybe we just want to sort into a folder called "pickers".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer a flat directory of components! I tend to think a flat directory is easier to maintain over time and that it makes it easier to find what you're looking for.