chore(lint): no-shadow in sidebar-workspace-list.test, use-pr-pane-data.test

This commit is contained in:
Mohamed Boudra
2026-04-24 05:24:31 +07:00
parent 41529b68bd
commit d63f7cc2d7
2 changed files with 18 additions and 12 deletions

View File

@@ -203,11 +203,11 @@ function WorkspaceRowProbe({
workspaceId: string;
counts: RenderCounts;
}): null {
const workspace = useWorkspaceFields(serverId, workspaceId, (entry) =>
const workspaceEntry = useWorkspaceFields(serverId, workspaceId, (entry) =>
createSidebarWorkspaceEntry({ serverId, workspace: entry }),
);
if (workspace) {
incrementRecord(counts.rows, workspace.workspaceId);
if (workspaceEntry) {
incrementRecord(counts.rows, workspaceEntry.workspaceId);
}
return null;
}
@@ -223,7 +223,7 @@ function ProjectActiveProbe({
}): null {
useIsNavigationProjectActive({
serverId,
workspaceIds: project.workspaces.map((workspace) => workspace.workspaceId),
workspaceIds: project.workspaces.map((entry) => entry.workspaceId),
});
incrementRecord(counts.projectSelection, project.projectKey);
return null;
@@ -253,16 +253,16 @@ function SidebarFrameProbe({ counts }: { counts: RenderCounts }): ReactElement {
<div key={project.projectKey}>
<ProjectHeaderProbe project={project} counts={counts} />
<ProjectActiveProbe serverId={SERVER_ID} project={project} counts={counts} />
{project.workspaces.map((workspace) => (
<React.Fragment key={workspace.workspaceKey}>
{project.workspaces.map((entry) => (
<React.Fragment key={entry.workspaceKey}>
<WorkspaceRowProbe
serverId={workspace.serverId}
workspaceId={workspace.workspaceId}
serverId={entry.serverId}
workspaceId={entry.workspaceId}
counts={counts}
/>
<WorkspaceSelectionProbe
serverId={workspace.serverId}
workspaceId={workspace.workspaceId}
serverId={entry.serverId}
workspaceId={entry.workspaceId}
counts={counts}
/>
</React.Fragment>

View File

@@ -766,9 +766,15 @@ function createDeferred<T>(): {
return { promise, resolve };
}
function countTimelineCalls({ cwd, prNumber }: { cwd: string; prNumber: number }): number {
function countTimelineCalls({
cwd: targetCwd,
prNumber,
}: {
cwd: string;
prNumber: number;
}): number {
return mockClient.pullRequestTimeline.mock.calls.filter(([input]) => {
const request = input as { cwd?: string; prNumber?: number | null };
return request.cwd === cwd && request.prNumber === prNumber;
return request.cwd === targetCwd && request.prNumber === prNumber;
}).length;
}