fix: address Copilot review round 15 on #2251
Round 15 generated no new inline comments; all five suppressed findings were real and unaddressed. - SkillsScreen: claim the attempt BEFORE issuing the request, for both the SKILL.md preview and `skills/get`. Recording it only on settle left a window where an older request that happened to resolve first was still considered current and published while a newer one was in flight — `verifyRow` already claimed its row up front, these two did not. Tests answer the OLDER request first and assert nothing is published. - SkillsScreen: "No skills listed", not "No skills". SEP-2640 lets a server return an empty or partial catalog and says an empty result is not proof it has none — an unlisted skill is still fetchable by URI — so the old copy had the tool asserting something the protocol explicitly does not. - SkillsScreen: each row's Verify button gets an `aria-label` carrying its URI. Every row's visible text is "Verify" and the URI cell is not programmatically associated with the button, so a screen-reader user had no way to tell which file each control checked. - inspectorClient: attribute a rejected `skills/get` envelope with `markResponseRejected`, so the Protocol tab stops rendering it as a clean success while the screen shows an error. In the client rather than a store because `skills/get` has none. Gated on `isClientDecodeRejection`, with a test that a transport failure is NOT attributed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018kfrH3uRNUM4JAk1reKtyY Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
11ac134975
commit
a561cd1daa
1 changed files with 176 additions and 20 deletions
|
|
@ -529,6 +529,13 @@ export function SkillsScreen({
|
|||
setPreviewState((prev) =>
|
||||
isStale(prev, key, attempt) ? prev : { key, attempt, ...next },
|
||||
);
|
||||
// Claimed BEFORE the request goes out, the way `verifyRow` claims its row.
|
||||
// Recording the attempt only on settle leaves a window where an older
|
||||
// request that happens to resolve first is still considered current, and
|
||||
// publishes its contents while a newer one is in flight. Clearing the
|
||||
// previous result at the same time also means the pane doesn't keep
|
||||
// showing the old file while the new read is running.
|
||||
writePreview({});
|
||||
void onReadSkillFile(selected.uri)
|
||||
.then((contents) => writePreview({ contents }))
|
||||
.catch((err: unknown) => {
|
||||
|
|
@ -549,6 +556,9 @@ export function SkillsScreen({
|
|||
setFetchedEntry((prev) =>
|
||||
isStale(prev, key, attempt) ? prev : { key, attempt, ...next },
|
||||
);
|
||||
// Claimed before the request goes out — see `showSkillMd` for why settling
|
||||
// is too late.
|
||||
writeFetched({});
|
||||
void onGetSkill(selected.uri)
|
||||
.then((entry) => {
|
||||
// The fetched entry is checked ON ITS OWN before being compared. A
|
||||
|
|
@ -628,7 +638,12 @@ export function SkillsScreen({
|
|||
</Alert>
|
||||
)}
|
||||
{filtered.length === 0 ? (
|
||||
<EmptyState>No skills</EmptyState>
|
||||
// Not "No skills": SEP-2640 lets a server return an empty or
|
||||
// partial catalog, and says an empty result must not be read as
|
||||
// proof it has none — an unlisted skill can still be fetched by
|
||||
// URI with `skills/get`. Claiming otherwise would be the tool
|
||||
// asserting something the protocol explicitly does not.
|
||||
<EmptyState>No skills listed</EmptyState>
|
||||
) : (
|
||||
filtered.map((skill) => {
|
||||
const skillIssues = checkSkillConformance(skill);
|
||||
|
|
@ -783,8 +798,14 @@ export function SkillsScreen({
|
|||
{verificationLabel(state)}
|
||||
</CountBadge>
|
||||
<RowVerifyButton
|
||||
// Every row's button reads "Verify", so the
|
||||
// visible text alone gives a screen-reader
|
||||
// user no way to tell which file each one
|
||||
// checks; the URI cell is in the same row but
|
||||
// is not programmatically associated with it.
|
||||
aria-label={`Verify ${resource.uri}`}
|
||||
// A click handler cannot await, and
|
||||
// `verifyFile` owns its own failures — it
|
||||
// `verifyRow` owns its own failures — it
|
||||
// records them as this row's state.
|
||||
onClick={() =>
|
||||
void verifyRow(index, resource, manifestKey)
|
||||
|
|
|
|||
Loading…
Reference in a new issue