Add optional click tracking to clickable components
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
Direzione di ricerca
Inizia esaminando i componenti interattivi elencati—BBButton, BBBCheckbox, BBBToggle, BBBAccordion, BBBNavigation, BBBSelect, BBBSearch e BBBModal—e il modo in cui sono implementate le loro callback di interazione. Usa il modulo proposto src/clickTracker.ts e ispeziona il percorso di export della libreria. Il lavoro è completo quando le interazioni con id producono il report richiesto, resetClickReport lo cancella e i componenti senza ids mantengono il comportamento esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 5
- Merge medio
- 2g 5h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bigbluebutton/bbb-ui-components-react
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark modeForse già presa @nisatsama l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bigbluebutton/bbb-ui-components-react#100 · 1 commento ·
-
Add support for dark themeApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Add standard component for notifications (BBBToast)Forse già presa @Arthurk12 l’ha presa 33 giorni fa. Apertaenhancement
bigbluebutton/bbb-ui-components-react#72 · 1 assegnatario ·
Tutte le issue di bigbluebutton/bbb-ui-components-react
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
siyuan-note/siyuan#20313 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
DevTools page styles leak into the host app in developmentForse già presa @onmax l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nuxt-modules/better-auth#567 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno