Skip to content

[UI/UX:Forum] Fix search clear#12622

Merged
bmcutler merged 26 commits into
Submitty:mainfrom
GarvitKhandelwal31:forum-search1-clean
Jun 8, 2026
Merged

[UI/UX:Forum] Fix search clear#12622
bmcutler merged 26 commits into
Submitty:mainfrom
GarvitKhandelwal31:forum-search1-clean

Conversation

@GarvitKhandelwal31

@GarvitKhandelwal31 GarvitKhandelwal31 commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #12619.

The Discussion Forum search bar is high traffic and had several UX regressions:

  • Clear x icon briefly appeared when search was empty.
  • Clear x icon appeared on Create Thread even when no text was entered.
  • Search text persisted across reload/navigation, which could silently filter results.
  • Search/filter interaction could trigger unsaved-changes warnings unexpectedly.
  • Toggling the clear x icon caused subtle layout shift in the search input width.

This PR resolves those issues to make forum filtering behavior more predictable and polished.

What is the New Behavior?

  • The clear x control is integrated inside the search input area.
  • The clear x is hidden when search is empty, and only shown when text exists.
  • Search text no longer persists across reload/navigation.
  • Search/filter interactions no longer trigger false unsaved-changes warnings.
  • Clear Filters visibility stays consistent with active filters/search state.
  • Input width remains stable when the clear x appears/disappears.

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Open Discussion Forum main page.
    Expected: search input is visible, clear x is hidden initially.
image
  1. Wait briefly after load.
    Expected: clear x does not flash on/off when input is empty.
Screen.Recording.2026-03-22.020718.mp4
  1. Type a term in search input (for example, markdown), then click Search.
    Expected: thread list is filtered and clear x is visible inside the input.
image
  1. Observe the search input while clear x appears/disappears.
    Expected: no input width shrink or horizontal layout shift.

  2. Click the clear x.
    Expected: search input clears, clear x hides, filtered list resets to unfiltered state.

  3. Apply a comment/question/unread filter plus a search term.
    Expected: Clear Filters appears.

image
  1. Click Clear Filters.
    Expected: search text clears, selected filters reset, Clear Filters hides when nothing is active.
  1. No search bar in create threads page-
image
  1. Unmatched results in search-
    Previously if search results did not matched, it showed all of them.
    But now it shows no threads found.
image
  1. Warning shown on unsaved changes-
    In create threads page, if a user edits the title, or description and try to reload or navigate to other page, a warning message appears saying there are unsaved changes-
    https://github.com/user-attachments/assets/19d0a7fc-8163-4a82-80c5-6b79eb0d0c11
  2. In dark mode, if no results matched, error looks like this-
image

Automated Testing & Documentation

  • Manual verification completed using the steps above.
  • No automated tests were added in this PR.
  • No submitty.org documentation updates are required, since behavior is a UI bugfix refinement of existing forum search/filter interactions.

Other information

  • Breaking change: No.
  • Migrations required: No.
  • Security impact: None identified.

@codecov

codecov Bot commented Mar 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 21.62%. Comparing base (3edad87) to head (06f94c8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12622   +/-   ##
=========================================
  Coverage     21.62%   21.62%           
  Complexity     9824     9824           
=========================================
  Files           268      268           
  Lines         36816    36816           
  Branches        490      490           
=========================================
  Hits           7960     7960           
  Misses        28370    28370           
  Partials        486      486           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.02% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <0.00%> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JManion32 JManion32 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.

Functionality is significantly improved so far. Everything specified in the original issue is addressed. A few more things:

  1. Let's remove that forum search bar header from the create threads page, and move the Back to Threads button to the top right of the create thread container. Forum search has zero functionality there.
  2. Currently when no threads are found via search, it shows all of them. It should show no threads as it did before, and maybe we could include a message where the threads would be saying no threads found?

Overall, great job with this. I will do a more thorough functionality / code review once these small changes are made, and CI is passing (I just approved the workflows so it may already be fine).

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Mar 22, 2026
@GarvitKhandelwal31

GarvitKhandelwal31 commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review.
Updates-
I have made a commit for your two more suggested features and updated description on how to verify them.

The previous workflow check failed on CI( Gradeable)-
My analysis on that-
My changes were limited to form-only related files, but the check failed on from a different spec cypress/e2e/Cypress-Gradeable/late_submission_warning_messages.spec.js, given scope and failure location it looks like an existing, intermittent Gradeables CI issue.

@Rkoester47 Rkoester47 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.

These are great changes and improve the quality of life for the search feature. One small issue that I found in my testing was that the message displayed for no results is very difficult to read in dark mode. This should be addressed, but otherwise great work.

Image

@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author

Hey, thanks so reviewing my PR. I have fixed the issue. Now it looks like this-
image
Also updated the description

@JManion32 JManion32 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.

The banner should not be light in dark mode. Please use a darker color.

@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author
image How's this?

@JManion32 JManion32 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.

The padding at the top seems to have changed on the view threads and create thread pages:

View Threads:
Image

Create Threads:
Image

Let's just make sure the padding stays the same even though we are moving things around.

Comment thread site/app/templates/forum/createThread.twig Outdated
@GarvitKhandelwal31

GarvitKhandelwal31 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

My apologies for the late reply.
image
image
image
image

@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Mar 29, 2026

@JManion32 JManion32 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.

I would just like to see the padding be consistent between the headers on these 2 pages (screenshots in dark mode so its easier to see the contrast):
Image
Image
On the create thread page, there is just less space. I want the Create Thread and Back to Threads buttons to be in the same spot on the screen, but since the create thread page has less padding in the header, they are not.

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Mar 31, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 14:01
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Apr 1, 2026
@GarvitKhandelwal31

GarvitKhandelwal31 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor Author
image @JManion32 I think the padding is decent now.

@Rkoester47

Copy link
Copy Markdown
Contributor

image @JManion32 I think the padding is decent now.

image @JManion32 I think the padding is decent now.

I just checked out your branch, and the padding for these two pages still seems to be different. The spacing above these elements should match.

Create Thread Button
image

Back to Threads Button
image

@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author

Hey @Rkoester47 , I have tried doing the same, but to me it looks good-
image
image

image image

@Rkoester47 Rkoester47 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.

After installing your branch again, I also see the matching padding between both pages.

@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author

Hey one thing today came into my mind, we can do one more thing in the search in discussion forum-
Lets say we search markdown in the bar, then in the results it should highlight markdown with some color, I think this would make much more sense.
If you would want I can add this too. @JManion32 @Rkoester47

@JManion32

Copy link
Copy Markdown
Contributor

Hey one thing today came into my mind, we can do one more thing in the search in discussion forum- Lets say we search markdown in the bar, then in the results it should highlight markdown with some color, I think this would make much more sense. If you would want I can add this too. @JManion32 @Rkoester47

This sounds like a separate issue for another PR to me.

@JManion32 JManion32 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.

Great work @GarvitKhandelwal31 ! To fix those padding changes once and for all, I have a proposal:

  1. Remove the margin top/left/right for create-thread-header
  2. Remove padding: 0; from forum_content

I think this looks much better:
Image

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Apr 30, 2026
@GarvitKhandelwal31

Copy link
Copy Markdown
Contributor Author

Great work @GarvitKhandelwal31 ! To fix those padding changes once and for all, I have a proposal:

  1. Remove the margin top/left/right for create-thread-header
  2. Remove padding: 0; from forum_content

I think this looks much better: Image

Done, I have also cross checked again, and functionality looks unharmed.

@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 16, 2026
@GarvitKhandelwal31 GarvitKhandelwal31 moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development May 19, 2026
@GarvitKhandelwal31 GarvitKhandelwal31 removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 19, 2026
@automateprojectmangement automateprojectmangement Bot moved this from Awaiting Maintainer Review to In Review in Submitty Development May 19, 2026

@dagemcn dagemcn 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.

Functionality works great, no issues I could find, and previous bugs and padding issues have been resolved. Tested in light and dark mode.

@bmcutler
bmcutler merged commit 8aefcc1 into Submitty:main Jun 8, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Enhance Forum Search Feature

6 participants