Skip to content

feat: attribute filtering for logs search#1720

Closed
tgmendes wants to merge 9 commits intomainfrom
AGE-1436/inline-filter-chips-in-search-bar
Closed

feat: attribute filtering for logs search#1720
tgmendes wants to merge 9 commits intomainfrom
AGE-1436/inline-filter-chips-in-search-bar

Conversation

@tgmendes
Copy link
Copy Markdown
Contributor

@tgmendes tgmendes commented Feb 27, 2026

Summary

Adds a Datadog-inspired unified search bar to the logs page that supports filtering by any log attribute, alongside the existing URN text search.

  • Attribute filter types & operators (attribute-filter-types.ts): defines the ActiveAttributeFilter model with support for =, , ~ (contains), exists, and (not exists) operators
  • URL sync (attribute-filter-url.ts): serializes/deserializes active filters to/from the af URL search param so filters survive page reloads and are shareable
  • Query hook (use-attribute-logs-query.ts): calls telemetrySearchLogs with attribute filters, groups results by traceId into ToolCallSummary objects, and supports infinite scrolling
  • Unified search bar (AttributeFilterBar.tsx): Datadog-style tag input where filter chips render inline inside the input. The filter flow (key → operator → value) builds inside a single chip with an embedded value input. Popover only appears for key suggestions and operator selection.
  • Logs page integration (Logs.tsx): wires everything together — uses listAttributeKeys for autocomplete, swaps to the attribute-filter query when filters are active, and syncs filter state with URL params

UX details

  • Typing in the search bar suggests matching attribute keys from the backend
  • Selecting a key opens an operator picker, then value is typed inline inside the chip
  • Completed filters appear as dismissible chips inline in the search bar
  • Backspace on empty input removes the last chip
  • Enter commits the current filter value
  • Escape cancels the in-progress filter flow
  • All filters are persisted in the URL via the af query param
Screen.Recording.2026-02-27.at.18.35.49.mov

Closes AGE-1436

Test plan

  • Type text → attribute key suggestions appear
  • Complete key → operator → value flow → chip appears inline
  • Value is typed inside the chip alongside the key and operator
  • Multiple chips wrap to next line, input grows
  • Click X on individual chip → removed
  • Backspace on empty input removes last chip
  • Backspace on empty value input cancels in-progress filter
  • Clear-all X removes all chips
  • Escape dismisses popover / cancels flow
  • Filters persist in URL (af param) and survive page reload
  • URN text search still works alongside attribute filters

🤖 Generated with Claude Code

Rework AttributeFilterBar to render filter chips inline inside the
search input (Datadog-style) instead of a separate row below. The
in-progress filter builds inside a single chip with an embedded value
input. Backspace removes chips, Enter commits filters.
@linear
Copy link
Copy Markdown

linear Bot commented Feb 27, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Mar 2, 2026 5:03pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: 55cdf94

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
dashboard Minor
@gram-ai/create-function Minor
@gram/client Minor
@gram-ai/functions Minor
server Patch
@gram-ai/elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tgmendes tgmendes changed the title feat: inline filter chips in logs search bar feat: attribute filtering for logs search Feb 27, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

- Tab key now commits filter value (same as Enter)
- Enter/Tab on main input submits text search (no popover open)
- Remove 500ms debounce — search query only updates on Enter, Tab, or clear
Tab now acts like Enter throughout the filter flow: selects the
highlighted attribute key, picks an operator, and commits values.
Tab is always trapped so focus never leaves the search bar.
- Encode filter path/value with encodeURIComponent in URL serialization
  to prevent corruption when values contain commas or colons
- Deduplicate trace summaries across pages when attribute filters are
  active (traces spanning page boundaries are merged by traceId)
- Fix spacing between operator and value in filter pill (use non-breaking
  space so CSS flex doesn't collapse it)
- Replace existing filter on same path+op instead of appending, avoiding
  impossible AND conditions (e.g. status_code=404 AND status_code=500)
- Refactor key handlers to switch statements for readability
@tgmendes tgmendes marked this pull request as ready for review March 2, 2026 15:17
devin-ai-integration[bot]

This comment was marked as resolved.

@tgmendes
Copy link
Copy Markdown
Contributor Author

tgmendes commented Mar 2, 2026

Botched PR with merge conflicts - closing in favour of #1751

@tgmendes tgmendes closed this Mar 2, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant