Skip to content

fix(web): keep modules visible when switching to manual sort - #10342

Open
JunaidAhamed-7777 wants to merge 1 commit into
makeplane:previewfrom
JunaidAhamed-7777:fix-module-manual-sort-transition
Open

JunaidAhamed-7777 wants to merge 1 commit into
makeplane:previewfrom
JunaidAhamed-7777:fix-module-manual-sort-transition

Conversation

@JunaidAhamed-7777

@JunaidAhamed-7777 JunaidAhamed-7777 commented Nov 17, 2026 •

Copy link
Copy Markdown

Description

Switching to Manual from any descending module sort makes the active or archived module list empty. The dropdown sends -sort_order, but the list only recognizes sort_order. The invalid preference also survives a reload.

Use the option being selected, rather than the current sort mode, to decide whether to keep the descending prefix. Manual always sends sort_order; other sortable columns keep the current direction. If an invalid preference was already saved, selecting Manual again replaces it.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots and Media (if applicable)

No visual design changes. The authenticated browser flow was not run.

Test Scenarios

  1. In a project with modules, open the Modules sort dropdown and choose Name, then Descending.
  2. Select Manual. Previously, the list became empty; the expected result is that the modules remain visible, ordered by their manual positions.
  3. In the archived list, use the same transition with archived modules. Switching between non-manual fields should still preserve the current sort direction.

An isolated regression harness exercised the actual React dropdown click handlers and the module ordering utility using pinned dependencies: five regressions failed on unchanged preview; all 13 cases passed with the fix. Web formatting, lint and route type generation/TypeScript checks passed. The unchanged workspace-wide check was blocked by the local i18n generator's socket requirement; it was not verified end to end. No backend files changed.

References

Found while tracing module sorting. This is separate from #10204, which corrects the actual descending sort of several fields; it does not change the dropdown.

Summary by CodeRabbit

  • Bug Fixes
    • Sorting options now consistently follow the selected ascending or descending direction. Manual ordering remains unprefixed, including when selected while descending.

Do not copy the descending prefix onto the Manual option. Both module views expect sort_order, and -sort_order falls through to an empty list.
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When descending order is active, selected keys now receive a - prefix unless the selected key is sort_order.

Changes: Descending sort key

Layer / File(s) Summary
Descending key prefix
apps/web/components/modules/dropdowns/order-by.tsx
The descending-order branch checks whether the selected option is sort_order. Other selected keys receive a - prefix.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to a9c23

Switching to Manual sort now sends the key the module lists recognize, so modules stay visible. Reselecting Manual should also replace a previously saved invalid preference. No actionable merge risk was found. The authenticated browser flow was not run by the author.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the bug fix (module visibility after switching to manual sort) and the web component area. It matches the single-line change in the order-by dropdown that stops the descending prefix f…
Description check Passed The description follows the template. It states the bug and the fix, marks the Bug fix type, and gives manual test steps and a regression harness result. The Screenshots section says no visual change …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the bug fix (module visibility after switching to manual sort) and the web component area. It matches the single-line change in the order-by dropdown that stops the descending prefix from being applied to sort_order.

Full details: Description check

Explanation

The description follows the template. It states the bug and the fix, marks the Bug fix type, and gives manual test steps and a regression harness result. The Screenshots section says no visual change applies and explains the browser flow was not run. The References section links a related PR (#10204) but does not link an issue. The Description section and test steps are complete, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 761a079c-de17-48d8-9a57-025d13267419
Commits

Reviewing files that changed from the base of the PR and between d6f3195 and a9c2304.

Files selected for processing: 1

  • apps/web/components/modules/dropdowns/order-by.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant