Skip to content

Need of fixing trending sort crash and dark mode UI #23

Open

Description

@vd77-1

Problem

The /api/questions endpoint throws a 500 error when using sort=trending.

Error:

TypeError: Invalid sort value: { $expr: [object Object] }

The issue occurs because aggregation expressions were being passed directly into Mongoose .sort(), which only supports field-based sorting.

Additionally, some text on the Ask Question page had low visibility in dark mode.

Proposed Fix
Replace invalid $expr sort usage with valid field-based sorting
Improve subtitle/readability styling in dark mode
Minor UI polish for better user experience
Tested
Questions page loads correctly
Trending filter no longer crashes
Dark mode subtitle visibility improved
Authentication and question flow still work properly

Activity

  1. vd77-1 commented on May 21, 2026

    @vd77-1
    Author

    Hi @Ashmita1206, I would like to work on this issue.
    I have already identified the root cause and tested a fix locally.
    Could you please assign this issue to me?

  2. changed the title [-]Fix trending sort crash and improve dark mode UI[/-] [+]Need of fixing trending sort crash and dark mode UI[/+] on May 22, 2026
  3. Surbhi10052007 commented on May 22, 2026

    @Surbhi10052007

    Hi @maintainer

    I would like to work on this bug under GSSoC'26.

    I plan to:

    • Improve toast notification visibility and readability
    • Fix overlay/transparency issues affecting the UI
    • Enhance contrast and positioning for better user experience
    • Ensure responsiveness and consistent styling across themes

    Please assign this issue to me

    Thank you!

  4. Akshat-Neeraj commented on May 26, 2026

    @Akshat-Neeraj

    Hi @Ashmita1206 I would like to work on this issue under GSSoC'26. I’ve reviewed the issue and identified that the trending sort logic and dark mode styling both need fixes. I plan to:

    • resolve the invalid sorting behavior safely
    • improve dark mode readability/contrast
    • ensure the existing question flow remains stable
      I’ll test the changes locally before submitting a PR.
      Can you please assign this issue to me if possible.
      Thank you!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions