Skillpedia
المواقع والواجهات (frontend)7.2k · #13474

thinking-orbs

ما الذي تفعله

تضيف هذه المهارة مكون thinking-orbs في React، الذي يُظهر أن الذكاء الاصطناعي مشغول. وهي مخصصة للمطورين الذين يبنون واجهات محادثة أو مساعدين أو بحث أو صوت، ويريدون مؤشرًا واضحًا بدل دائرة تحميل عادية.

متى تستخدمها

  • ✓عندما تحتاج واجهة المحادثة أو المساعد إلى إظهار أن الذكاء الاصطناعي يعمل أو يبحث.
  • ✓عندما تريد استبدال دائرة التحميل العامة بمؤشر لنشاط الذكاء الاصطناعي.
  • ✓عندما يجب أن تُظهر ميزة صوتية أو توليد نص أنها تستمع أو تكتب.

رابط المهارة

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/thinking-orbs/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/thinking-orbs/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أريد أن يُظهر تطبيق المحادثة الخاص بي كرة صغيرة متحركة أثناء تفكير الذكاء الاصطناعي، بدل دائرة تحميل عادية.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يثبّت وكيلك الحزمة في مشروع React، ويربط الخطوات الفعلية في تطبيقك بإحدى الحالات الست المدمجة. يضبط الحجم والسمة والتسمية، ويضيف خيار تقليل الحركة حتى يمكن إيقاف الكرة أو إخفاؤها لأسباب تتعلق بإمكانية الوصول.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Thinking Orbs

Core Contract

  1. Use thinking-orbs in React 18+ interfaces that need indeterminate AI activity feedback.
  2. Map the real product lifecycle to one of the six shipped states.
  3. Use only the tuned 20 or 64 pixel size. Do not stretch one preset into another.
  4. Keep theme="auto" unless the surrounding surface has a known fixed theme.
  5. Pair the orb with concise visible status text when the activity matters to the user.
  6. Override aria-label with a task-specific label, or hide the orb from assistive technology when adjacent live text already announces the same state.
  7. Use paused to freeze the current frame. Do not simulate pause with speed={0}.
  8. Treat the orb as indeterminate feedback, never as a progress percentage or completion signal.

The package renders monochrome dots on a transparent 2D canvas. It does not expose custom colors, arbitrary sizes, or determinate progress.

Install

Inspect the project package manager, then install:

npm install thinking-orbs

The package declares react and react-dom version 18 or newer as peer dependencies. Import the component and exported types from the package root:

import {
  ThinkingOrb,
  type OrbSize,
  type OrbState,
  type OrbTheme,
  type ThinkingOrbProps,
} from "thinking-orbs";

Choose the State

  • working — generic tool execution, multi-step work, or an activity without a more precise state.
  • searching — retrieval, web search, file search, or knowledge lookup.
  • solving — reasoning, analysis, calculation, or planning.
  • listening — microphone input, speech capture, or waiting for a spoken turn.
  • composing — writing, summarizing, drafting, or generating a text response.
  • shaping — creating or refining an image, layout, structured artifact, or other formed output.

Prefer a truthful generic working state over a visually interesting but inaccurate state. Change the state only when the underlying activity changes.

Choose the Size

  • Use size={20} inline with text, inside buttons, or in compact status rows.
  • Use size={64} at chat-avatar scale, in an empty state, or as the main visual status.

The presets have different dot counts, dot sizes, and speed tuning. They are separate designs rather than a scale factor. If the layout needs more surrounding space, size the wrapper instead of applying CSS transforms to the canvas.

Basic Usage

import { ThinkingOrb } from "thinking-orbs";

export function AgentStatus() {
  return (
    <ThinkingOrb
      state="searching"
      size={20}
      theme="auto"
      aria-label="Searching project files…"
    />
  );
}

All other canvas props pass through, including className, style, data-*, event handlers, and ARIA attributes.

Model the Product Lifecycle

Keep product phases separate from visual states so the mapping stays explicit:

import { ThinkingOrb, type OrbState } from "thinking-orbs";

type AgentPhase =
  | "idle"
  | "retrieving"
  | "reasoning"
  | "writing"
  | "creating"
  | "done"
  | "error";

const ORB_BY_PHASE: Partial<Record<AgentPhase, OrbState>> = {
  retrieving: "searching",
  reasoning: "solving",
  writing: "composing",
  creating: "shaping",
};

export function AgentActivity({ phase }: { phase: AgentPhase }) {
  const state = ORB_BY_PHASE[phase];
  if (!state) return null;

  return <ThinkingOrb state={state} size={20} />;
}

Remove the orb on done, error, cancellation, or idle. Show the appropriate result, retry, or error UI instead of leaving the last activity animation running.

Announce Status Once

The component defaults to role="img" with a per-state label such as “Searching…”. When visible text describes the same state, make the text the single announcement source:

export function LiveAgentStatus() {
  return (
    <div role="status" aria-live="polite" className="agent-status">
      <ThinkingOrb state="solving" size={20} aria-hidden="true" />
      <span>Reviewing the repository…</span>
    </div>
  );
}

Use aria-live="polite" for ordinary phase changes. Avoid rapid label churn. Do not add another hidden live region when role="status" already owns the announcement.

Theme

Use one of:

<ThinkingOrb theme="auto" />
<ThinkingOrb theme="dark" />
<ThinkingOrb theme="light" />
  • auto first checks an ancestor data-theme="dark|light" attribute or dark / light class.
  • If no ancestor theme exists, auto follows prefers-color-scheme.
الأسئلة الشائعة

هل تُظهر مدى تقدم المهمة؟

لا. تُظهر الكرة نشاطًا غير محدد فقط، ولا تعرض نسبة مئوية أو اكتمالًا أبدًا.

ما إصدارات React التي تحتاجها؟

تحتاج الحزمة React 18 أو أحدث.

هل يمكنني اختيار ألوان مخصصة؟

لا. تقول المهارة إن الحزمة ترسم نقاطًا أحادية اللون ولا تتيح ألوانًا أو أحجامًا عشوائية.

التفاصيل

الوصف الأصلي من المؤلف

Add accessible animated AI loading and agent-status indicators with the React thinking-orbs library. Use when a chat, copilot, voice, search, generation, or tool-running interface needs a semantic working, searching, solving, listening, composing, or shaping state; when replacing a generic spinner with an AI activity orb; or when implementing the library's size, theme, speed, pause, reduced-motion, and canvas behavior.

repo: MengTo/Skills

الشعبية

نجوم GitHub
7.2k
الترتيب
#13474
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة