Skip to content

prefactor: generalize filterable index layout and components - #13768

Merged
parlough merged 18 commits into
mainfrom
refactor-filterable-index
Aug 26, 2026
Merged

prefactor: generalize filterable index layout and components#13768
parlough merged 18 commits into
mainfrom
refactor-filterable-index

Conversation

@ericwindmill

@ericwindmill ericwindmill commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description of what this PR is changing or adding, and why:

Extract generic two-column filterable index layout styles and sidebar/search components from learning resources index into reusable filterable_index.dart and _filterable-index.scss.

This change anticipates new content for FlutterBench, where I'm adding a CUJ index #13691

Extract generic two-column filterable index layout styles and sidebar/search
components from learning resources into reusable filterable_index.dart
and _filterable-index.scss.
@ericwindmill
ericwindmill requested review from a team and sfshaza2 as code owners August 20, 2026 19:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the filterable index pages by extracting shared layout, sidebar, and search group components and styles into reusable Dart components (FiltersSidebar, FilterSearchGroup) and a shared SASS stylesheet (_filterable-index.scss), successfully reducing code duplication. The feedback highlights a critical issue in filterable_index.dart where event.target is unsafely cast to web.Element? using the 'as' operator, which can lead to a runtime TypeError. It is recommended to use a safe type check (is web.Element) instead.

Comment thread sites/docs/lib/src/components/pages/filterable_index.dart
@ericwindmill
ericwindmill requested a review from parlough August 20, 2026 19:09
@flutter-website-bot

flutter-website-bot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated docs.flutter.dev site (updated for commit 1263a08):

https://flutter-docs-prod--docs-pr13768-refactor-filterable-in-fnqqj8yi.web.app

@flutter-website-bot

flutter-website-bot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated flutter.dev site (updated for commit 1263a08):

https://flutter-dev-230821--www-pr13768-refactor-filterable-in-6oidcs4i.web.app

@parlough parlough left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for extracting this out @ericwindmill! Mostly looks good to me.

Should the learning resources index be updated to use the new FilterSearchGroup?

Comment thread sites/docs/lib/src/components/pages/filterable_index.dart
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart Outdated
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart Outdated
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart
Comment thread sites/docs/lib/_sass/components/_filterable-index.scss

@parlough parlough left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for those updates @ericwindmill! Looks good to me after a few final adjustments:

Comment thread sites/docs/lib/_sass/components/_filterable-index.scss Outdated
Comment thread sites/docs/lib/_sass/components/_filterable-index.scss Outdated
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart Outdated
Comment thread sites/docs/lib/src/components/pages/filterable_index.dart Outdated
Comment thread sites/docs/lib/src/components/pages/learning_resource_filters_sidebar.dart Outdated
@parlough
parlough merged commit bf67a87 into main Aug 26, 2026
16 checks passed
@parlough
parlough deleted the refactor-filterable-index branch August 26, 2026 11:26
@ericwindmill ericwindmill mentioned this pull request Aug 26, 2026
4 tasks
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.

3 participants