Repository navigation
FlutterBench leaderboard filters - #14171
ericwindmill wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a filtering mechanism to the interactive Flutter benchmark leaderboard, allowing users to filter results by agent and model. It adds a new BenchControls component containing dropdown filters and a clear button, integrates it into the FlutterBenchInteractive stateful component, and applies corresponding SCSS styles. Feedback on the changes suggests optimizing the filter behavior so that changing the selected agent does not unconditionally reset the selected model, but instead only clears it if the newly selected agent does not support that model.
| onAgentChanged: (agent) => setState(() { | ||
| _selectedAgent = agent; | ||
| // The selected model might not exist for the new agent. | ||
| _selectedModel = null; | ||
| }), |
There was a problem hiding this comment.
Unconditionally resetting _selectedModel to null whenever the agent changes can lead to a frustrating user experience. For example, if a user selects a model first (or has a model selected that is supported by multiple agents) and then changes the agent, or if they clear the agent filter to see the model across all agents, the model filter is unnecessarily cleared.
Instead, we should only clear the selected model if the newly selected agent does not support it.
onAgentChanged: (agent) => setState(() {
_selectedAgent = agent;
if (agent != null && _selectedModel != null) {
final hasModel = _allComparisons.any(
(c) => c.agent == agent && c.model == _selectedModel,
);
if (!hasModel) _selectedModel = null;
}
}),References
- Report an issue only if the change introduces or worsens it, it's of medium severity or higher, and you can state its concrete consequence. (link)
|
Staged preview of the updated flutter.dev site (updated for commit a97ea91): https://flutter-dev-230821--www-pr14171-fb-4-controls-tk5095rt.web.app |
c553d23 to
24d0053
Compare
24d0053 to
a97ea91
Compare
Description of what this PR is changing or adding, and why:
Adds agent and model filters above the FlutterBench leaderboard.
components/flutterbench/bench_controls.dart:BenchControls, with labeled Agent and Model dropdowns and a "Clear filters" button that appears while a filter is set.flutterbench_interactive.dart: filter state. The model list narrows to the selected agent's models, and changing the agent resets the model._flutterbench-controls.scss,Presubmit checklist
of 80 characters or fewer.