panel-component-aggregator
यह क्या करती है
यह स्किल AI एजेंट को ऐसा सारांश पैनल बनाने का मार्गदर्शन देती है जो खुद डेटा नहीं लाता। यह उन डेवलपर्स के लिए है जो ऐसा पैनल चाहते हैं जो दूसरे पैनलों द्वारा लोड किए गए डेटा को जोड़े।
कब इस्तेमाल करें
- ✓जब सारांश पैनल को वह डेटा जोड़ना हो जो दूसरे पैनल पहले ही ला चुके हैं।
- ✓जब डेटा अलग-अलग समय पर आए और सारांश हर बार अपडेट होना चाहिए।
- ✓जब ऐसे पैनल से अतिरिक्त नेटवर्क कॉल से बचना हो जो केवल कुल या सारांश दिखाता है।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/panel-component-aggregator/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे स्टॉक और बिक्री पैनलों से भेजी गई संख्याओं का कुल दिखाने वाला सारांश पैनल बनाइए, और तभी दिखाइए जब पर्याप्त डेटा आ जाए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक aggregator बेस क्लास बनाता है जो भेजे गए आंशिक डेटा को रखती है और ट्रैक करती है कि कौन से फ़ील्ड आ चुके हैं। जब तक ज़रूरी फ़ील्ड न आएं, वह पहली रेंडर नहीं करती, और उसके बाद हर नए डेटा पर फिर से रेंडर करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Aggregator Panel Component Pattern
Create aggregator dashboard panel components using vanilla TypeScript (no framework, no JSX).
An aggregator panel does not fetch data itself. Instead, it receives partial data pushes from sibling panels (or a coordinator) via updateData(partial), defers its first render until enough data has arrived, and re-renders incrementally on each subsequent push.
This skill is self-contained. It covers the base Panel class, the AggregatorPanel generic base class, and a concrete example (SummaryPanel).
When to Use This Pattern
| Use case | Fetching Panel | Aggregator Panel |
|---|---|---|
| Panel owns its own API endpoint | yes | no |
| Panel summarises data from multiple sources | no | yes |
| Data arrives asynchronously from siblings | no | yes |
| Re-renders on each push without extra network calls | no | yes |
Architecture Overview
Panel (base class)
└── AggregatorPanel<TData> (generic aggregator base)
├── partialData: Partial<TData> — accumulated pushed fields
├── receivedKeys: Set<keyof TData> — tracks which keys have arrived
├── requiredKeys: (keyof TData)[] — keys needed before first render
├── lastUpdated: Map<keyof TData, number> — staleness timestamps
└── SummaryPanel (concrete example)
Data flow:
StockPanel ──pushes──► coordinator.push('stocks', quotes)
EmailPanel ──pushes──► coordinator.push('emails', messages)
│
AggregatorPanel.updateData({ stocks, emails })
│
┌──────────▼──────────┐
│ enough data yet? │
│ no → showPending │
│ yes → render() │
└─────────────────────┘
Base Panel Class
Create src/components/Panel.ts:
export interface PanelOptions {
id: string;
title: string;
showCount?: boolean;
className?: string;
}
export class Panel {
protected element: HTMLElement;
protected content: HTMLElement;
protected header: HTMLElement;
protected countEl: HTMLElement | null = null;
protected panelId: string;
private _fetching = false;
constructor(options: PanelOptions) {
this.panelId = options.id;
this.element = document.createElement('div');
this.element.className = `panel ${options.className || ''}`.trim();
this.element.dataset.panel = options.id;
// Header
this.header = document.createElement('div');
this.header.className = 'panel-header';
const headerLeft = document.createElement('div');
headerLeft.className = 'panel-header-left';
const title = document.createElement('span');
title.className = 'panel-title';
title.textContent = options.title;
headerLeft.appendChild(title);
this.header.appendChild(headerLeft);
if (options.showCount) {
this.countEl = document.createElement('span');
this.countEl.className = 'panel-count';
this.countEl.textContent = '0';
this.header.appendChild(this.countEl);
}
this.content = document.createElement('div');
this.content.className = 'panel-content';
this.content.id = `${options.id}Content`;
this.element.appendChild(this.header);
this.element.appendChild(this.content);
}
public getElement(): HTMLElement { return this.element; }
public showLoading(message = 'Loading...'): void {
this.content.innerHTML = `
<div class="panel-loading">
<div class="panel-loading-spinner"></div>
<div class="panel-loading-text">${message}</div>
</div>`;
}
/** Show a "waiting for data" placeholder — softer than showLoading */
public showPending(message = 'Waiting for data\u2026'): void {
this.content.innerHTML = `
<div class="panel-pending">
<div class="panel-pending-text">${message}</div>
</div>`;
}
public showError(message = 'Failed to load', onRetry?: () => void): void {
this.content.innerHTML = `
<div class="panel-error-state">
<div class="panel-error-msg">${message}</div>
${onRetry ? '<button class="panel-retry-btn" data-panel-retry>Retry</button>' : ''}
</div>`;
if (onRetry) {
this.content.querySelector('[data-panel-retry]')
?.addEventListener('click', onRetry);
}
}
public setContent(html: string): void { this.content.innerHTML = html; }
public setCount(count: number): void {
if (this.c
अक्सर पूछे जाने वाले सवाल
क्या सारांश पैनल अपनी API कॉल करता है?
नहीं, स्किल कहती है कि aggregator पैनल सहोदर पैनलों या कोऑर्डिनेटर से भेजा गया डेटा लेते हैं।
यह पहली बार कब दिखता है?
जब सभी ज़रूरी डेटा फ़ील्ड आ जाते हैं, तब यह पहली बार रेंडर होता है।
ताज़गी कैसे जांची जाती है?
स्किल हर फ़ील्ड के लिए टाइमस्टैम्प रखती है, ताकि पुराने मान पहचाने जा सकें।
जानकारी
लेखक का मूल विवरण
Dashboard panel component pattern for aggregator/summary panels that accept pushed partial data updates via updateData(), defer rendering until first data arrives, and incrementally re-render metrics without re-fetching — ideal for panels that synthesize data already fetched by other panels.
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #13065
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।