Skip to content

feat: add sorting options to plugins page#74

Open
DavidGBrett wants to merge 6 commits intoFlow-Launcher:masterfrom
DavidGBrett:sort-plugins
Open

feat: add sorting options to plugins page#74
DavidGBrett wants to merge 6 commits intoFlow-Launcher:masterfrom
DavidGBrett:sort-plugins

Conversation

@DavidGBrett
Copy link
Copy Markdown
Contributor

@DavidGBrett DavidGBrett commented Apr 2, 2026

Add sorting dropdown to plugin page, with the following options:

  • Name (A-Z)
  • Name (Z-A)
  • Release Date
  • Last Updated

defined in pluginSortOptions.ts

Modified index.astro to add the dropdown and the clientside sorting functionality to match the existing filtering functionality

Related to this request:
https://www.reddit.com/r/FlowLauncher/comments/1s8gcrm/plugin_sort_by_date_created_or_updated/

UI Change

image

@DavidGBrett DavidGBrett marked this pull request as ready for review April 2, 2026 11:28
@coderabbitai coderabbitai bot added the enhancement New feature or request label Apr 2, 2026
@coderabbitai

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/pages/plugins/index.astro (1)

170-191: Consider omitting the default sort from the query string.

Right now /plugins rewrites itself to /plugins?sort=name-asc on first load even before the user changes anything. Deleting the param when the selection is the default keeps the clean route canonical.

♻️ Suggested cleanup
-  url.searchParams.set("sort", sortValue);
+  if (sortValue === DEFAULT_PLUGIN_SORT) {
+    url.searchParams.delete("sort");
+  } else {
+    url.searchParams.set("sort", sortValue);
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/plugins/index.astro` around lines 170 - 191, The updateUrlParams
function currently always writes the sort query param; change it to omit the
sort param when the current selection is the default so the canonical URL stays
clean. In updateUrlParams (using sortSelect and sortValue) compare sortValue
against the default sort (use sortSelect.defaultValue or the literal "name-asc"
if that's the default) and only call url.searchParams.set("sort", sortValue)
when it differs; otherwise call url.searchParams.delete("sort") before calling
history.replaceState.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pages/plugins/index.astro`:
- Around line 170-191: The updateUrlParams function currently always writes the
sort query param; change it to omit the sort param when the current selection is
the default so the canonical URL stays clean. In updateUrlParams (using
sortSelect and sortValue) compare sortValue against the default sort (use
sortSelect.defaultValue or the literal "name-asc" if that's the default) and
only call url.searchParams.set("sort", sortValue) when it differs; otherwise
call url.searchParams.delete("sort") before calling history.replaceState.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c2df1c0-a2b0-4acb-b8f8-08148622a91b

📥 Commits

Reviewing files that changed from the base of the PR and between 8b29de9 and 063e922.

📒 Files selected for processing (2)
  • src/pages/plugins/index.astro
  • src/pages/plugins/pluginSortOptions.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/pages/plugins/index.astro (1)

188-192: Use strict equality and consistent spacing.

Minor style inconsistencies: the comparison uses != instead of !== (unlike line 56 which uses ===), and spacing around braces is inconsistent with the rest of the file.

✨ Suggested fix for consistency
-  if (sortValue != DEFAULT_PLUGIN_SORT){
+  if (sortValue !== DEFAULT_PLUGIN_SORT) {
     url.searchParams.set("sort", sortValue);
-  } else{
+  } else {
     url.searchParams.delete("sort");
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/plugins/index.astro` around lines 188 - 192, The comparison should
use strict equality and brace spacing must match the file style: change the
condition to compare with !== (use sortValue !== DEFAULT_PLUGIN_SORT) and adjust
the else block spacing to `} else {` so the branches call
url.searchParams.set("sort", sortValue) and url.searchParams.delete("sort")
respectively; update the snippet around sortValue, DEFAULT_PLUGIN_SORT, and
url.searchParams.set/delete for consistent formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pages/plugins/index.astro`:
- Around line 188-192: The comparison should use strict equality and brace
spacing must match the file style: change the condition to compare with !== (use
sortValue !== DEFAULT_PLUGIN_SORT) and adjust the else block spacing to `} else
{` so the branches call url.searchParams.set("sort", sortValue) and
url.searchParams.delete("sort") respectively; update the snippet around
sortValue, DEFAULT_PLUGIN_SORT, and url.searchParams.set/delete for consistent
formatting.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d3a0643c-92bd-4761-b397-ad04ca388a5b

📥 Commits

Reviewing files that changed from the base of the PR and between 063e922 and 672f7e7.

📒 Files selected for processing (1)
  • src/pages/plugins/index.astro

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/pages/plugins/index.astro (2)

188-192: Prefer strict equality for consistency.

Same style issue as line 156: use !== instead of != for string comparison.

✨ Suggested fix
-  if (sortValue != DEFAULT_PLUGIN_SORT){
+  if (sortValue !== DEFAULT_PLUGIN_SORT) {
     url.searchParams.set("sort", sortValue);
-  } else{
+  } else {
     url.searchParams.delete("sort");
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/plugins/index.astro` around lines 188 - 192, The condition
comparing sortValue to DEFAULT_PLUGIN_SORT uses loose equality; update the if
statement that checks "if (sortValue != DEFAULT_PLUGIN_SORT)" to use strict
inequality (===/!==), i.e., change to "!==", so the comparison in the block
handling url.searchParams.set/delete uses strict equality between sortValue and
DEFAULT_PLUGIN_SORT.

156-156: Use strict equality and consistent formatting.

This line has inconsistent formatting and uses loose equality. For string comparisons, strict equality (!==) is preferred.

✨ Suggested formatting fix
-if(sortParam != DEFAULT_PLUGIN_SORT){applySort();}
+if (sortParam !== DEFAULT_PLUGIN_SORT) {
+  applySort();
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/plugins/index.astro` at line 156, Replace the loose inequality and
cramped formatting in the conditional that checks sortParam by using strict
inequality and consistent spacing; update the expression comparing sortParam to
DEFAULT_PLUGIN_SORT to use !== and add spaces and braces for readability,
ensuring the block calling applySort() (referenced by sortParam,
DEFAULT_PLUGIN_SORT, applySort) follows the project's formatting style.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/pages/plugins/index.astro`:
- Around line 188-192: The condition comparing sortValue to DEFAULT_PLUGIN_SORT
uses loose equality; update the if statement that checks "if (sortValue !=
DEFAULT_PLUGIN_SORT)" to use strict inequality (===/!==), i.e., change to "!==",
so the comparison in the block handling url.searchParams.set/delete uses strict
equality between sortValue and DEFAULT_PLUGIN_SORT.
- Line 156: Replace the loose inequality and cramped formatting in the
conditional that checks sortParam by using strict inequality and consistent
spacing; update the expression comparing sortParam to DEFAULT_PLUGIN_SORT to use
!== and add spaces and braces for readability, ensuring the block calling
applySort() (referenced by sortParam, DEFAULT_PLUGIN_SORT, applySort) follows
the project's formatting style.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7b93f97-bdc6-4e93-8bab-729ad0f4d95f

📥 Commits

Reviewing files that changed from the base of the PR and between 672f7e7 and f8bad3a.

📒 Files selected for processing (1)
  • src/pages/plugins/index.astro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant