Add optional click tracking to clickable components
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- react, typescript
調査の方向性
まず、列挙されているインタラクティブコンポーネント—BBButton、BBBCheckbox、BBBToggle、BBBAccordion、BBBNavigation、BBBSelect、BBBSearch、BBBModal—と、それらのインタラクションコールバックがどのように実装されているかを確認します。提案されている src/clickTracker.ts モジュールを使用し、ライブラリのエクスポートパスを調べます。id を持つインタラクションが要求されたレポートを生成し、resetClickReport がそれをクリアし、id のないコンポーネントが既存の動作を維持すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Consumers of this library often need to track which components are being interacted with for analytics or usage telemetry purposes. Currently, they must manually wrap every component's onClick to collect this data, which is repetitive boilerplate that has to be maintained outside the library.
Describe the solution you'd like
An opt-in, zero-configuration click tracking system built into the library. When a consumer passes an id prop to any clickable component, clicks are automatically counted in an internal store. The consumer retrieves the report by calling a single exported function whenever needed.
// src/clickTracker.ts (new module)
export function getClickReport(): Record<string, number>
export function resetClickReport(): void
// internal — called by components
function trackClick(id: string): void
Describe alternatives you've considered
- Base class / class inheritance: Discarded — this library uses functional components with hooks throughout. A class hierarchy would require rewriting all components and goes against React's compositional model.
- Higher-Order Component (HOC): Would work but adds unnecessary wrapping complexity for a use case that doesn't require it.
- Context + Provider: Makes the system reactive (triggers re-renders), but requires consumers to wrap their app with a
<ClickTrackerProvider>, which is unnecessary overhead for a simple analytics report.
Affected component(s)
All components that have meaningful user interaction:
-
BBButton -
BBBCheckbox -
BBBToggle -
BBBAccordion(expand/collapse) -
BBBNavigation(item clicks) -
BBBSelect(option selection) -
BBBSearch(search action) -
BBBModal(action buttons)
Proposed API / Usage Example
import { BBButton, BBBToggle, getClickReport, resetClickReport } from '@mconf/bbb-ui-components-react';
// No setup required — tracking activates automatically when id is passed
function App() {
return (
<>
<BBButton id="confirm-btn" onClick={handleConfirm} label="Confirm" />
<BBBToggle id="notifications-toggle" onChange={handleToggle} />
</>
);
}
// Retrieve the report whenever needed (e.g. on page unload, on user logout)
const report = getClickReport();
// → { "confirm-btn": 14, "notifications-toggle": 3 }
sendToAnalytics(report);
resetClickReport(); // optional: reset counters
Components without an id prop are silently ignored — zero behavior change for existing consumers.
Screenshots or mockups
N/A
Additional context
- TypeScript type
ClickReport = Record<string, number>should be exported alongside the functions. resetClickReport()enables consumers to segment data by session or time window.- The module is a singleton (module-level
Map<string, number>), so it works across the entire component tree without any provider or context setup. - Easily testable: call
resetClickReport()between tests to isolate state.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 5
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bigbluebutton/bbb-ui-components-react のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bigbluebutton/bbb-ui-components-react#108 ·
メンテナーはふだん 1 日以内に返信
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark mode再び着手できるかも @nisatsama が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bigbluebutton/bbb-ui-components-react#100 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bigbluebutton/bbb-ui-components-react#107 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 55/100
bigbluebutton/bbb-ui-components-react#106 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
bigbluebutton/bbb-ui-components-react#105 ·
メンテナーはふだん 1 日以内に返信
bigbluebutton/bbb-ui-components-react の issue をすべて見る
似ている issue
-
category::task code priority::normal
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
e0ipso/strikethroo#145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
cocos/cocos-docs#3333 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RevenueCat/react-native-purchases#2079 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RevenueCat/purchases-hybrid-common#2039 ·
メンテナーはふだん 1 日以内に返信
-
agent-reported area/react bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信