Skip to content

Render classification label pills for image/audio entries in viewer - #14

Merged
hemanth-asirvatham merged 1 commit into
mainfrom
fix-classification-labels-for-images
Feb 7, 2026
Merged

Render classification label pills for image/audio entries in viewer#14
hemanth-asirvatham merged 1 commit into
mainfrom
fix-classification-labels-for-images

Conversation

@hemanth-asirvatham

Copy link
Copy Markdown
Collaborator

Motivation

  • Images displayed in the notebook viewer were showing rating pills but not their classification labels (audio already showed both), and large media-heavy DataFrames make the viewer very slow to render.
  • The change aims to surface snippet-style classification labels as compact "pills" for media rows and to ensure category label overrides are respected when rendering header pills.
  • Also consider scalability: avoid rendering full content for huge datasets by using the viewer's existing caps or sampling before calling gabriel.view.

Description

  • Added a helper _extract_label_pills(snippet_map, max_labels=24) that collects unique snippet strings to show as label pills for a passage. (file: src/gabriel/utils/passage_viewer.py).
  • Attach label_pills to each passage payload when media is present so image/audio rows can display classification labels without losing existing behavior. (file: src/gabriel/utils/passage_viewer.py).
  • Extended _build_header_html to accept category_labels and label_pills, use category_labels for pretty category pills, and render a new "Labels" pill stack when label_pills are provided. (file: src/gabriel/utils/passage_viewer.py).
  • Wired the header rendering to pass category_labels and label_pills for each entry when assembling the viewer HTML payload; no public API surface changes to view(...) parameters. (file: src/gabriel/utils/passage_viewer.py).

Testing

  • No automated tests were executed as part of this change.
  • Recommend manual / notebook smoke checks: call gabriel.view on a small DataFrame containing image/audio cells with snippet-style classification columns and verify header shows both category pills and the new Labels stack; for large datasets, validate responsiveness using max_passages or by sampling the DataFrame (e.g., df.sample(10)).

Codex Task

@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@hemanth-asirvatham
hemanth-asirvatham merged commit fb03d41 into main Feb 7, 2026
1 check failed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant