Skip to content
Back to skills

2026 09 05 Sonnet

ASecurity

```tsx import { useEffect, useState } from "react";

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsgoreactapi

Works with

  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 15, 2026

npx -y skills add AgentsORG/design-engineering --skill 2026-09-05-sonnet --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2026 09 05 Sonnet?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2026 09 05 Sonnet
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/agentsorg-2026-09-05-sonnet-09e12e94/badge)](https://www.skillsdirectory.com/skills/agentsorg-2026-09-05-sonnet-09e12e94)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Repair: spinner flashes on a 150ms request

## Fixed code

```tsx
import { useEffect, useState } from "react";

/**
 * Only reports "loading" once the request has been in flight longer
 * than `delay`. Fast responses (the 150ms case) never flip this true,
 * so nothing renders — no flash.
 */
function useDelayedLoading(isLoading: boolean, delay = 800) {
  const [showSpinner, setShowSpinner] = useState(false);

  useEffect(() => {
    if (!isLoading) {
      setShowSpinner(false);
      return;
    }
    const timer = setTimeout(() => setShowSpinner(true), delay);
    return () => clearTimeout(timer);
  }, [isLoading, delay]);

  return showSpinner;
}

function MyComponent({ isLoading }: { isLoading: boolean }) {
  const showSpinner = useDelayedLoading(isLoading);

  return <>{showSpinner && <Spinner />}</>;
}
```

## Rationale

The bug is a textbook case in the skill's loading-state choice tree ([[empty-loading-states]]): 0–800ms should render nothing, with a spinner only introduced after the 800ms mark, because anything shorter reads as a flash rather than feedback — this exact scenario ("Agent reached for `<Spinner />` on a 200ms API call. Created a flash.") is a standing entry in [[gotchas]]. The fix moves the decision from "is `isLoading` true" to "has `isLoading` been true for longer than the threshold," via a `setTimeout` that's cleared if the request resolves first, so a 150ms round trip never mounts the spinner at all. This is a loading-arrival issue, not a layout-shift-from-animation one, so per [[disambiguation]] it stays scoped to [[empty-loading-states]] rather than [[transform-opacity-only]]. No [[pov]] override applies here — the Duolingo fork doesn't touch loading-state timing, so canonical defaults hold; [[states-are-the-work]] confirms this class of fix (empty/loading/error) is core product work, not a nitpick.

Files in this skill

  • REPORT.md1.3 KB
  • edit-dropdown-01.baseline.md1.2 KB
  • edit-dropdown-01.skill.md2.2 KB
  • edit-hover-01.baseline.md741 B
  • edit-hover-01.skill.md2.6 KB
  • gen-form-01.baseline.md11.2 KB
  • gen-form-01.skill.md16.2 KB
  • gen-modal-01.baseline.md7.2 KB
  • gen-modal-01.skill.md10.7 KB
  • gen-send-sound-01.baseline.md10.4 KB
  • gen-send-sound-01.skill.md10.5 KB
  • gen-toolbar-01.baseline.md5.2 KB
  • gen-toolbar-01.skill.md12.2 KB
  • repair-darkmode-01.baseline.md1.1 KB
  • repair-darkmode-01.skill.md2 KB
  • repair-focus-01.baseline.md1.7 KB
  • repair-focus-01.skill.md2.9 KB
  • repair-input-01.baseline.md1003 B
  • repair-input-01.skill.md1.7 KB
  • repair-spinner-01.baseline.md1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.