Skip to content

Conversation

@MarkusNeusinger
Copy link
Owner

Summary

  • Extract CatalogLink, GridSizeToggle, ToolbarActions components from FilterBar.tsx to eliminate code duplication
  • Fix filter dropdown to show all available values when a category is selected without typing a query
  • Update parse_plot_path to use current directory structure (plots/{spec-id}/implementations/{library}.py)

Test plan

  • Verify toolbar icons (catalog link, grid toggle) work on desktop and mobile
  • Click on "Library" filter without typing - should show all 9 libraries
  • Type in filter search - fuzzy search should still work
  • Run unit tests for workflow_utils and workflow_cli

🤖 Generated with Claude Code

- Extract CatalogLink, GridSizeToggle, ToolbarActions from FilterBar.tsx
- Eliminate code duplication between desktop and mobile toolbar views
- Fix filter dropdown to show all values when category selected without query
- Update parse_plot_path to use current directory structure
- Update related tests for new path format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 21, 2026 22:41
Copy link
Contributor

Copilot AI left a comment

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 refactors the frontend FilterBar component and updates the backend plot path parsing to align with the current directory structure. The main changes include extracting reusable toolbar components and fixing a UX issue in the filter dropdown.

Changes:

  • Refactored ToolbarActions components from FilterBar.tsx to eliminate code duplication between desktop and mobile views
  • Fixed filter dropdown to display all available values when a category is selected without typing a query
  • Updated parse_plot_path function and tests to use the current directory structure: plots/{spec-id}/implementations/{library}.py

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
app/src/components/ToolbarActions.tsx New component extracting CatalogLink and GridSizeToggle to eliminate duplication
app/src/components/FilterBar.tsx Refactored to use ToolbarActions component and fixed dropdown to show all values when category selected without query
automation/scripts/workflow_utils.py Updated parse_plot_path to match new directory structure (plots/{spec-id}/implementations/{library}.py)
automation/scripts/README.md Updated comment documenting new parse_plot_path format
tests/unit/automation/scripts/test_workflow_utils.py Updated tests for new parse_plot_path format and added test for all libraries
tests/unit/automation/scripts/test_workflow_cli.py Updated CLI tests for new parse_plot_path format and added test to verify old format is invalid

Comment on lines 201 to 206
match = re.match(r"plots/([^/]+)/implementations/([^/]+)\.py$", file_path)
if match:
return {
"library": match.group(1),
"plot_type": match.group(2),
"spec_id": match.group(3),
"variant": match.group(4),
"spec_id": match.group(1),
"library": match.group(2),
}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The parse_plot_path function should validate that the extracted library name is a valid library. Without validation, invalid library names like "plots/scatter-basic/implementations/invalid-lib.py" would be accepted. Consider adding library validation by checking if the library value is in VALID_LIBRARIES before returning the result.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Address Copilot review feedback: reject paths with invalid library names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MarkusNeusinger MarkusNeusinger merged commit ac02a97 into main Jan 21, 2026
8 checks passed
@MarkusNeusinger MarkusNeusinger deleted the refactor/code-quality-improvements-v2 branch January 21, 2026 23:02
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.

2 participants