Spaces:
Sleeping
Sleeping
Commit History
11 days ago
-
Track which languages are used on the Usage tab
Adds a lang column to usage_tracking.py (migrated in-place for existing DBs, same pattern as the earlier uid migration), storing the human-readable language label (e.g. "Japanese") rather than the internal eSpeak code, since it's only ever used for display. Threaded through every tracked event that has language context: analyze(), get_alternate_options(), run_allosaurus(), and keyboard-open (which didn't have a language input before -- added the language dropdown to kb_btn.click's inputs). get_summary() now returns a "languages" breakdown (all distinct languages used, not capped like top_words since there are only ~22 possible values), surfaced as a new "Usage by language" table on the Usage tab. CSV export includes the new column too. Verified locally: migration from a pre-lang-column DB, language-count aggregation, blank/whitespace lang values correctly excluded (same normalization as text/uid), CSV export header, and a full analyze()-to -rendered-HTML smoke test confirming the lan…5bf9426
-
Track unique users on the Usage tab
Adds an anonymous, per-browser id (a UUID generated client-side and stored in localStorage, via the same gr.Blocks(js=...) page-load mechanism already used for keyboard-similarity highlighting) so the Usage tab can report distinct users rather than just event counts. Threaded through every tracked action (analyze, keyboard open, alternate options, Allosaurus) via a hidden textbox input. usage_tracking.py gains a uid column (migrated in-place for existing DBs), an all-time unique-users count, and a per-day unique-users column. No real identity is ever collected — the id ties to nothing but itself, and is simply absent for any browser that blocks localStorage. Note: the JS->hidden-textbox mechanism is the standard, well-documented Gradio pattern for this, but local live-browser verification wasn't possible this round due to a sandbox restriction on spinning up a test server -- worth a quick manual click-through on the deployed Space to confirm the uid box populates as expected. Co-Aut…aff1e48
-
Sync usage stats to a private HF dataset repo for durability
The local SQLite file doesn't survive a Space restart on its own. When the HF_TOKEN Space secret is configured, usage_tracking.py now restores it from ZacDLX1915/ipa-translator-usage-stats at cold start (only if no local DB exists yet) and pushes it back after each new event, throttled to once per 5 minutes. Entirely optional and best-effort — with no HF_TOKEN set, everything behaves exactly as before (local-only). Also adds a "Sync to HF now" button on the Usage tab for a forced, unthrottled push plus a plain-language status message, so the sync can be verified/triggered on demand rather than only waiting for the next throttle window. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>632020d -
Add Usage tab: track feature adoption and words tried
Logs analyze() calls (split by typed text / self-recording / uploaded recording via the Audio component's stop_recording/upload events), IPA keyboard opens, alternate-options requests, and Allosaurus runs to a local SQLite file, plus the word/phrase each event was for. New "Usage" tab shows counts by feature, a day-by-day activity table, and a most-tried-words list, with a CSV export for backup since the DB resets on container restart. All logging is best-effort and never raises, so a stats problem can't affect the app people rely on. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>a97aba3