Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ describe('StudioMemberBindPanel', () => {
expect(screen.getByTestId('studio-bind-snippet-section')).toBeTruthy();
expect(screen.getByTestId('studio-bind-supporting-section')).toBeTruthy();
expect(screen.getByText('Current member publication')).toBeTruthy();
expect(screen.getByText('member:default')).toBeTruthy();
expect(screen.queryByRole('combobox')).toBeNull();
expect(
screen.queryByText('Select a published service'),
).toBeNull();
expect(screen.getByRole('button', { name: 'Chat' })).toHaveAttribute(
'aria-pressed',
'true',
);
fireEvent.click(screen.getByText('Contract details'));
expect(await screen.findByText('Published service')).toBeTruthy();
expect(primaryGrid.contains(screen.getByText('Published service'))).toBe(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,9 @@ const StudioMemberBindPanel: React.FC<StudioMemberBindPanelProps> = ({
'No published contract'}
</Typography.Text>
<Typography.Text type="secondary">
{selectedService?.serviceId || 'No service id'}
{normalizedMemberId
? `member:${normalizedMemberId}`
: 'No member selected'}
</Typography.Text>
</div>
</div>
Expand All @@ -1011,8 +1013,9 @@ const StudioMemberBindPanel: React.FC<StudioMemberBindPanelProps> = ({
const active = endpoint.endpointId === selectedEndpointId;
return (
<button
key={endpoint.endpointId}
aria-pressed={active}
className={AEVATAR_INTERACTIVE_CHIP_CLASS}
key={endpoint.endpointId}
type="button"
style={
active
Expand All @@ -1030,7 +1033,8 @@ const StudioMemberBindPanel: React.FC<StudioMemberBindPanelProps> = ({
<div style={valueCardStyle}>
<Typography.Text strong>No endpoint data available</Typography.Text>
<Typography.Text type="secondary">
This member publication has not exposed callable endpoints yet.
This member publication has not exposed callable endpoints
yet. Bind can still show revision diagnostics below.
</Typography.Text>
</div>
)}
Expand Down
72 changes: 72 additions & 0 deletions apps/aevatar-console-web/src/pages/studio/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4285,6 +4285,78 @@ describe("StudioPage", () => {
expect(screen.queryByText("services:default,billing-api")).toBeNull();
});

it("keeps Invoke on the selected member when a stale bind selection exists", async () => {
mockStudioMembers = [
...mockStudioMembers,
{
memberId: "support-member",
scopeId: "scope-1",
displayName: "support-member",
description: "Support member",
implementationKind: "workflow",
lifecycleStage: "bind_ready",
publishedServiceId: "support-service",
lastBoundRevisionId: "rev-support",
createdAt: "2026-04-27T08:00:00Z",
updatedAt: "2026-04-27T08:05:00Z",
},
];
mockScopeRuntimeApi.listServices.mockResolvedValue([
{
serviceId: "default",
displayName: "workspace-demo",
deploymentStatus: "Active",
primaryActorId: "actor-default",
endpoints: [
{
endpointId: "chat",
displayName: "Chat",
kind: "chat",
description: "Chat with workspace-demo.",
requestTypeUrl: "",
responseTypeUrl: "",
},
],
},
{
serviceId: "support-service",
displayName: "support-member",
deploymentStatus: "Active",
primaryActorId: "actor-support",
endpoints: [
{
endpointId: "support-chat",
displayName: "Support chat",
kind: "chat",
description: "Chat with support.",
requestTypeUrl: "",
responseTypeUrl: "",
},
],
},
]);

renderStudioPage(
"/studio?scopeId=scope-1&member=member%3Aworkspace-demo&step=bind"
);

expect(await screen.findByTestId("studio-bind-surface")).toBeTruthy();
fireEvent.click(screen.getByRole("button", { name: "Select bind endpoint" }));

await replaceStudioRoute(
"/studio?scopeId=scope-1&member=member%3Asupport-member&step=invoke"
);

expect(await screen.findByTestId("studio-invoke-surface")).toBeTruthy();
await waitFor(() => {
expect(screen.getByText("service:support-service")).toBeTruthy();
expect(screen.getByText("member:support-member")).toBeTruthy();
expect(screen.getByText("services:support-service")).toBeTruthy();
expect(screen.getByText("endpoint:support-chat")).toBeTruthy();
});
expect(screen.queryByText("service:default")).toBeNull();
});

it("shows an invoke empty state when a bound member has no endpoint data", async () => {
mockStudioMembers = [
...mockStudioMembers,
Expand Down
12 changes: 7 additions & 5 deletions apps/aevatar-console-web/src/pages/studio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7499,11 +7499,13 @@ const StudioPage: React.FC = () => {
const hasInvokeTargetMemberSelection =
Boolean(workbenchStudioMemberId);
const invokeTargetServiceId =
currentInvokeSelectionServiceId ||
currentBindingSelectionServiceId ||
currentSelectedMemberServiceId ||
trimOptional(workbenchPublishedService?.serviceId) ||
trimOptional(routeState.legacyServiceId);
hasInvokeTargetMemberSelection
? currentSelectedMemberServiceId
: currentInvokeSelectionServiceId ||
currentBindingSelectionServiceId ||
currentSelectedMemberServiceId ||
trimOptional(workbenchPublishedService?.serviceId) ||
trimOptional(routeState.legacyServiceId);
const invokeTargetService = useMemo(
() => {
if (!invokeTargetServiceId) {
Expand Down
Loading