Add optional click tracking to clickable components
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react, typescript
Research direction
Start by reviewing the listed interactive components—BBButton, BBBCheckbox, BBBToggle, BBBAccordion, BBBNavigation, BBBSelect, BBBSearch, and BBBModal—and how their interaction callbacks are implemented. Use the proposed src/clickTracker.ts module and inspect the library's export path. Done means id-bearing interactions produce the requested report, resetClickReport clears it, and components without ids retain existing behavior.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 5
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bigbluebutton/bbb-ui-components-react
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark modePossibly taken @nisatsama claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigbluebutton/bbb-ui-components-react#100 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Add standard component for notifications (BBBToast)Possibly taken @Arthurk12 claimed this 33 days ago. Openenhancement
bigbluebutton/bbb-ui-components-react#72 · 1 assignee ·
All issues in bigbluebutton/bbb-ui-components-react
Similar issues
-
embed: handleTurboSignMessage header comment says the signing page posts to '*' (it never does)Opendocumentation
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 70/100
udistrital/paginaweb_root#23 ·
-
Aborting a request that waits for a socket destroys that socket under a later request (socket hang up)Possibly taken @vvo claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ClickHouse/clickhouse-js#1040 ·
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Small-tailqwq/dsh-deep-whale#187 ·
Maintainers usually reply within 1 day
-
Tela Marca manda conferir o campo "Razão social", que em Portugal se chama "Denominação social"Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
melgarafael/DeskcommCRM#2503 ·
Maintainers usually reply within 1 day