Skip to content

Clarify local telemetry and harden Streamlit onboarding, diarization, and transcript UX - #1

Merged
potemkin666 merged 17 commits into
mainfrom
copilot/review-project-codebase
May 1, 2026
Merged

Clarify local telemetry and harden Streamlit onboarding, diarization, and transcript UX#1
potemkin666 merged 17 commits into
mainfrom
copilot/review-project-codebase

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

The app exposed several rough edges in first-run onboarding and transcript review: local telemetry was undocumented, speaker labeling was positioned too broadly for what is actually KMeans-based diarization, and parts of the Streamlit UI relied on brittle custom interactions. This change tightens the product surface by documenting local state, surfacing diarization context, and replacing fragile UI patterns with clearer, more accessible controls.

  • Privacy + product positioning

    • Documented the local telemetry file path and payload in:
      • app/README.md
      • app/docs/SECURITY.md
    • Clarified that speaker labeling is optional diarization based on speaker embeddings + KMeans clustering, not identity stitching or entity intelligence.
  • Diarization visibility

    • Loaded diarization.json into saved-output metadata.
    • Surfaced diarization diagnostics in the Transcript tab.
    • Added sidebar guidance for speaker count selection when users do not know the exact count.
    • Replaced raw spk 0.87 output with labeled speaker-match badges (High / Medium / Low) and heuristic explanations.
  • Transcript tab UX

    • Kept transcript reload support wired through ZIP/folder loading and included diarization metadata in the restored view.
    • Replaced injected HTML/JS copy widgets with native st.text_area plus an isolated copy component that supports keyboard interaction and standard copy fallbacks.
    • Simplified user-facing error messages for load/transcribe failures.
  • Transcribe / hot-folder onboarding

    • Added a concise first-run checklist under the uploader covering supported inputs, first model download delay, and ETA behavior.
    • Upgraded queue rows to include badge-style statuses and actionable remediation text instead of passive state changes.
    • Added platform-aware hot-folder examples and resolved-path guidance so folder/output behavior is easier to verify before starting.
  • UI complexity control

    • Hid the command palette from the public UI behind a feature flag for now.
    • Kept the underlying component accessible-ready with ARIA/keyboard handling for future re-enable.
def _speaker_confidence_badge(value: float | None) -> tuple[str, str, str]:
    if value is None:
        return ("Speaker match: n/a", "mid", "Speaker-label confidence is unavailable for this segment.")
    score = max(0.0, min(1.0, float(value)))
    if score >= 0.75:
        return ("Speaker match: High", "good", f"... Raw score: {score:.2f}.")
    if score >= 0.45:
        return ("Speaker match: Medium", "mid", f"... Raw score: {score:.2f}.")
    return ("Speaker match: Low", "low", f"... Raw score: {score:.2f}.")

Copilot AI and others added 17 commits May 1, 2026 15:54
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/9d3fbf5e-2e17-404c-a5df-ae4726e55813

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/9d3fbf5e-2e17-404c-a5df-ae4726e55813

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/6bf90d2a-b088-41d6-adb6-510e1a32229c

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/6bf90d2a-b088-41d6-adb6-510e1a32229c

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/d269cecf-f60e-4c2b-8522-57c143a5fdce

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/52b534da-8105-4392-9d3f-73b16426bbf7

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
Agent-Logs-Url: https://github.com/potemkin666/audio-transcriber/sessions/f94fc1d9-0a21-48ef-ad3d-e681c4259b3f

Co-authored-by: potemkin666 <183807833+potemkin666@users.noreply.github.com>
@potemkin666
potemkin666 marked this pull request as ready for review May 1, 2026 18:56
Copilot AI review requested due to automatic review settings May 1, 2026 18:56
@potemkin666
potemkin666 merged commit f0e594e into main May 1, 2026
3 checks passed
@potemkin666
potemkin666 deleted the copilot/review-project-codebase branch May 1, 2026 18:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the Streamlit app’s onboarding and transcript-review UX while clarifying privacy/telemetry behavior and more accurately positioning optional speaker labeling as KMeans-based diarization. It also hardens hot-folder de-dupe behavior and expands CI/test coverage to catch regressions earlier.

Changes:

  • Documented local telemetry storage/path and clarified diarization positioning in README + SECURITY docs.
  • Improved Streamlit UX for queue status, transcript diagnostics, saved-output reload, and copy-to-clipboard interactions; added diarization metadata surfacing.
  • Refactored hot-folder de-dupe into a shared decision helper with new hashing modes; added unit/smoke tests and a root CI workflow.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/watch_hotfolder.py Switches to shared hot-folder decision logic; adds “always hash before skip” mode and state persistence behavior.
app/transcriber/report.py Renames “Top moments” to “Heuristic highlights” and adds an explanatory note in brief outputs.
app/transcriber/hotfolder.py Introduces FileDecision + decide_file_action() to centralize hot-folder skip/process logic (incl. new hash mode).
app/transcriber/ffmpeg.py Improves missing-FFmpeg error messaging with platform-specific install hints; minor import cleanup.
app/transcriber/core.py Adds clearer Whisper-model download error messages; expands run stats/skipped-chunk counters and warning capture.
app/transcribe_cli.py Adds FFmpeg + model preflight checks and clearer CLI exit messages.
app/tests/test_smoke.py Adds smoke coverage for CLI help/model-preflight failure and key Streamlit helper functions.
app/tests/test_hotfolder.py Adds tests for state persistence and hash-before-skip behavior.
app/tests/test_formats.py Adds stable timestamp formatting tests for SRT/VTT/timestamped TXT.
app/streamlit_app.py Major UX updates: onboarding checklist, queue badges, safer upload filenames, transcript reload from ZIP/folder, diagnostics + diarization surfacing, and revised copy widget.
app/setup_unix.sh Adds failure trap with next steps and prints post-setup run/health-check guidance.
app/pyproject.toml Adds qrcode dependency to support LAN-mode QR rendering.
app/docs/SECURITY.md Updates disclosure guidance and documents local telemetry file contents/paths.
app/README.md Expands platform install/run instructions; documents telemetry and diarization positioning.
app/.github/workflows/ci.yml Removes app-local workflow (replaced by repo-root workflow).
app/.github/PULL_REQUEST_TEMPLATE.md Removes app-local PR template (replaced by repo-root template).
START_HERE.md Adds a root-level pointer guiding GitHub visitors into app/.
README.md Adds a root-level README that points to app/ and provides copy/paste install paths.
LICENSE Adds MIT license file at repo root.
.github/workflows/ci.yml Adds root CI with compileall, bash -n, inline smoke checks, and unittest discovery.
.github/PULL_REQUEST_TEMPLATE.md Adds root PR template with updated “How to test” checklist.
.github/ISSUE_TEMPLATE/bug_report.md Updates log-path guidance to app/logs/streamlit.err.log.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/streamlit_app.py
Comment on lines +114 to +117
def _copy_text_widget(*, key: str, label: str, value: str, height: int = 140) -> None:
dom_id = _safe_dom_id(key, prefix="copy")
st.text_area(label, value=value, height=height, key=f"{dom_id}_value")
payload = base64.b64encode(value.encode("utf-8")).decode("ascii")
Comment thread app/streamlit_app.py
"diarization": _read_json_file(output_dir / "diarization.json"),
}
)
return _collect_saved_outputs(rows, zip_bytes=_zip_dir(root))
Comment thread app/transcriber/core.py
Comment on lines +471 to 473
prepare_whisper_model(options.whisper_model, progress_cb=None)
model = _load_whisper_model_cached(options.whisper_model)
run_stats["timings"]["model_load_seconds"] = float(time.perf_counter() - t_model0)
Comment on lines +7 to +12
- [ ] `cd app && python - <<'PY'`
`from transcriber.formats import Segment, segments_to_srt, segments_to_vtt`
`segments = [Segment(0.0, 1.25, "Hello", "Speaker 1"), Segment(61.5, 62.0, "Bye")]`
`assert "WEBVTT" in segments_to_vtt(segments)`
`assert "00:00:00,000 --> 00:00:01,250" in segments_to_srt(segments)`
`PY`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants