Skip to content

[Refactor:Forum] Replace popups with tabs#12678

Merged
bmcutler merged 9 commits into
Submitty:mainfrom
Asterisk-Hunter:refactor/popup-to-new-tab
Jun 8, 2026
Merged

[Refactor:Forum] Replace popups with tabs#12678
bmcutler merged 9 commits into
Submitty:mainfrom
Asterisk-Hunter:refactor/popup-to-new-tab

Conversation

@Asterisk-Hunter

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Partially addresses #3271

Right now several places in the codebase use window.open() with popup window parameters like toolbar=no, width=700, height=600 which creates small fixed-size popup windows. These are harder for users to work with since they can't be resized freely, don't appear in the tab bar, and feel dated compared to just opening a normal browser tab.

What is the New Behavior?

Instead of opening restricted popup windows, links now open in regular browser tabs. Users can resize, bookmark, and use browser navigation on these pages like any other tab.

Before: Files and attachments opened in small 700x600 popup windows
After: Files and attachments open in normal browser tabs

What steps should a reviewer take to test this?

  1. Go to a forum thread with image attachments and click on an image - should open in new tab
  2. View a student submission and click "View" on a submitted file - should open in new tab
  3. Download student annotations from TA grading - should open in new tab
  4. Click on a thread link from the forum statistics page - should open in new tab

Automated Testing & Documentation

No new tests needed - this is a UX improvement that doesn't change functionality. The files still open and display the same content, just in a standard tab instead of a popup.

Other information

I left openPopUp() and openActionsPopup() alone for now since those actually write HTML content to the new window rather than just navigating to a URL. Converting those would require a different approach (maybe rendering to an inline modal or a dedicated page).

Partially addresses Submitty#3271

Remove window.open() popup parameters (toolbar, scrollbars, width, height)
to allow browsers to open URLs in standard new tabs instead of restricted
popup windows. This provides a better user experience as users can freely
resize, bookmark, and navigate these pages like normal browser tabs.

Changes:
- server.js: Simplified downloadStudentAnnotations(), openUrl(), and
  openSubmittedFile() to use window.open(url, '_blank')
- forum.js: Updated openFileForum(), openInWindow(), and attachment
  image click handlers
- drag-and-drop.js: Updated openFile()
- stat-page.js: Added explicit '_blank' target for consistency

Note: openPopUp() and openActionsPopup() functions that write HTML
content to popup windows are left unchanged as they require a different
refactoring approach.
@github-project-automation github-project-automation Bot moved this to Seeking Reviewer in Submitty Development Mar 29, 2026
@Asterisk-Hunter Asterisk-Hunter changed the title [Refactor:UI] Replace popup windows with new tab opens [Refactor:Forum] Replace popups with tabs Mar 29, 2026
@vimla01

vimla01 commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Tested locally and attached a video. Forum stats thread links now open in a normal tab for me, but the grading files path still opens a separate browser window:

sample/gradeable/grading_homework/grading/details -> uncheck Only Assigned Sections -> Grade a student -> Files -> Open/Close Submissions -> click the popout icon next to part1.py.

Expected a normal browser tab; got a separate browser window on my system. I also still see stale “pop up” wording in the grading UI, so I don’t think this is fully resolved yet.

testing_pr.webm

@Asterisk-Hunter

Asterisk-Hunter commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed test ,the video made it easy to pinpoint what was still wrong.

Two things were off:

  1. Stale text and icon in SubmissionPanel.twig the popout button next to each file still had aria-label="Open the file in a pop up" and the fa-window-restore (overlapping windows) icon. Those are now updated to "Open the file in a new tab" with fa-external-link-alt, matching how the same openSubmittedFile function is already labelled in Attachments.twig and Notebook.twig.

  2. Stale "View Popup" button in PeerResults.twig the peer grading PDF viewer had the same old wording and fa-window-restore icon, now updated to "View in New Tab" with fa-external-link-alt since openUrl there is also fixed.

The openSubmittedFile JS change (removing the width=700, height=600 features string) was already in the first commit window.open(url, '_blank') without a features argument opens in a tab per spec. If the popup window still appeared during your test, a hard-refresh (Ctrl+Shift+R) after pulling the branch should clear any cached server.js and show the tab behavior.

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

I tested the changes in this PR and can confirm that all of the areas described in the testing steps do pop out as a new tab now. I am a fan of tabs over a new window, especially a small window. As far as I can tell, this PR does what it sets out to do without any extra changes. Good work

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Mar 31, 2026
@Asterisk-Hunter

Copy link
Copy Markdown
Contributor Author

Thanks for the approval! Happy to finally get this merged. Let me know if you have any other issues I can help with.

@codecov

codecov Bot commented Mar 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.62%. Comparing base (249b9c9) to head (665eaaa).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12678   +/-   ##
=========================================
  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% <ø> (ø)
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.

@Asterisk-Hunter

Copy link
Copy Markdown
Contributor Author

I noticed the leaderboard test is timing out this looks like a pre-existing flaky test issue (not related to my changes). The test is about tied rankings on the leaderboard, which is completely separate from the popup-to-tab changes. Let me know if there's anything I need to do on my end, otherwise hoping this can be merged once CI passes.

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

I am reapproving this PR, since the functionality works. However, for some reason the Cypress Feature test is failing on Github. However, it passed locally on many reruns, and this might need to be addressed before merging.

@bmcutler bmcutler moved this from Awaiting Maintainer Review to Work in Progress in Submitty Development Jun 5, 2026
@bmcutler

bmcutler commented Jun 5, 2026

Copy link
Copy Markdown
Member

@Asterisk-Hunter @dandrecollins07-ctrl
please fix the failing javascript lint tests
and check out the failing cypress tests -- if any of the cypress fails are from this PR, please fix them.
(we are failing cypress tests on main for reasons unrelated to this PR)

@bmcutler bmcutler closed this Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from Work in Progress to Done in Submitty Development Jun 5, 2026
@bmcutler bmcutler reopened this Jun 5, 2026

@dandrecollins07-ctrl dandrecollins07-ctrl 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.

Passes various test cases, JavaScript lint case fixed. Approving.

@bmcutler
bmcutler merged commit 0dab9fa into Submitty:main Jun 8, 2026
24 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.

5 participants