Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add optional click tracking to clickable components

オープン
#49 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 の本文から書いたものです。

説明

enhancement

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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bigbluebutton/bbb-ui-components-react のほかの issue

bigbluebutton/bbb-ui-components-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。