Wire up autocomplete for free-text filter fields - #701
Conversation
FilterStateMachine has carried a field_values map and a set_field_values setter for autocompleting non-primary free-text fields, but nothing ever called the setter, so the map was always empty and value_candidates_for_field returned no suggestions for those fields. Populate it in sync_panel alongside the existing set_primary_values calls, so owners and tags (Dag), operator (TaskInstance) and endpoint (AirflowConfig) suggest the values actually present in the loaded data. Candidates are the individual values rather than the joined display string, since that is what a user types: owners renders as "alice, bob" but you filter with 'owners:alice'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127jzUgqqy8JVX5RydfQxh8
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
FilterStateMachinehas carried the machinery for autocompleting non-primary free-text fields all along:field_values: HashMap<String, Vec<String>>memberset_field_values(field, values)settervalue_candidates_for_fieldandedit_condition_stateat six call sitesNothing ever called the setter. The map was permanently empty, so
value_candidates_for_field'sFreeTextarm always returnedvec[]and those fields silently offered no suggestions.Affected filters
Four real fields, all declared via
impl_filterable!and all free-text:Dagowners,tagsTaskInstanceoperatorAirflowConfigendpointThe primary fields (
dag_id,dag_run_id,task_id,name) were never affected — they autocomplete fromprimary_values, whichsync_panelhas always populated.Change
Populate
field_valuesinsync_panelright beside the existingset_primary_valuescalls, so candidates reflect the data currently loaded.Candidates are the individual values rather than the joined display string, because that is what a user actually types:
ownersrenders as"alice, bob"but you filter withowners:alice, and matching is substring-based.A small
distinct()helper (sort, dedup, drop blanks) is shared by all four sites.Alternative considered
The other way to resolve this was deleting the machinery (~25 lines). Wiring it up costs less code and turns four filters that quietly under-serve into working ones, so I went this way — but the delete is a clean revert of this PR plus removal of the plumbing if you'd rather not carry the feature.
Verification
cargo test --workspace --lib --bins(95 passing, including a test fordistinct),cargo clippy --workspace --all-targets --all-features -- -D warnings, andcargo fmt --all --checkall clean.🤖 Generated with Claude Code
https://claude.ai/code/session_0127jzUgqqy8JVX5RydfQxh8
Generated by Claude Code