Skip to content

[Refactor:TAGrading] Events Infrastructure & StatusBanner#12941

Merged
bmcutler merged 27 commits into
Submitty:mainfrom
jndlansh:feature/status-banner-migration
Jun 30, 2026
Merged

[Refactor:TAGrading] Events Infrastructure & StatusBanner#12941
bmcutler merged 27 commits into
Submitty:mainfrom
jndlansh:feature/status-banner-migration

Conversation

@jndlansh

@jndlansh jndlansh commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

In this PR we set up the necessary infrastructure required for Vue migration.

  • Use props and emits in the Vue component.
  • The Vue component should not deal with external DOM directly
  • Just emit from the Vue component and our infrastructure will handle this in Component mounting in twig.
  • It uses an Events mapping in Twig file :
'events': {
    'color-change': '(event) => { document.body.style.background = event; }',
    'position-change': '(event) => { handlePositionChange(event.panelId, event.panelPosition); }',
}

PLUS

In the ongoing migration of Submitty's UI from legacy Twig + jQuery to Vue.js, in this PR we migrate the StatusBanner to vue.

What is the New Behavior?

ErrorMessage.twig is replaced by StatusBanner.vue, a pure display component that receives message and color as props
and emits color-change on mount so the parent can set the body background color. The component renders a colored banner
in the TA grading panel header showing submission status (late, no submission, withdrawn, overridden, etc.). No
behavioral change, the banner looks and works identically.

statusBanner.mp4

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

  1. Navigate to a TA grading page where the student has a submission status condition (late, no submission, withdrawn,
    overridden grades, etc.)
  2. Verify the colored banner appears in the grading panel header with the correct message and background color

Automated Testing & Documentation

  • Added Cypress Component Testing.
image

Other information

  • Not a Breaking change
  • No Migrations needed.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.36%. Comparing base (007eed8) to head (db7221d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12941   +/-   ##
=========================================
  Coverage     21.36%   21.36%           
  Complexity     9990     9990           
=========================================
  Files           274      274           
  Lines         37300    37300           
  Branches        499      499           
=========================================
  Hits           7969     7969           
  Misses        28836    28836           
  Partials        495      495           
Flag Coverage Δ
autograder 21.16% <ø> (ø)
js 1.99% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.41% <ø> (ø)
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.

Comment thread site/app/templates/Vue.twig Outdated
Comment thread site/vue/src/components/StatusBanner.vue
Comment thread site/vue/src/callbacks.ts Outdated
@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jun 25, 2026
@jndlansh jndlansh changed the title [Refactor:TAGrading] Migrate StatusBanner to Vue [Refactor:TAGrading] Migrate StatusBanner & Events Infra Jun 25, 2026
@jndlansh
jndlansh requested a review from williamjallen June 25, 2026 13:22
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Jun 25, 2026
@jndlansh jndlansh changed the title [Refactor:TAGrading] Migrate StatusBanner & Events Infra [Refactor:TAGrading]Events Infrastructure & Migrate StatusBanner Jun 29, 2026
@jndlansh jndlansh changed the title [Refactor:TAGrading]Events Infrastructure & Migrate StatusBanner [Refactor:TAGrading] Events Infrastructure & Migrate StatusBanner Jun 29, 2026
@jndlansh jndlansh changed the title [Refactor:TAGrading] Events Infrastructure & Migrate StatusBanner [Refactor:TAGrading] Events Infrastructure & StatusBanner Jun 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.

Nice work updating the description.

Functionality looks great, I only have requested changes (or I guess just removals) for the component tests. main.ts looks clean, and the new Vue component is using props and emits rather than relying on Submitty-specific behavior and functions.

A comment about the camelize and capitalize in main.ts:
We talked about this a little bit in our meeting today. Based on a quick search, this implementation with the camelize and capitalize is correct, since Vue expects event names to be kebab case and automatically maps them to camel case listeners. Looking at some older Vue components in the codebase, it looks like there is some inconsistency with event naming conventions that should probably be cleaned up in a separate PR.

Comment thread site/cypress/component/StatusBanner.cy.js Outdated
Comment thread site/cypress/component/StatusBanner.cy.js Outdated
Comment thread site/cypress/component/StatusBanner.cy.js Outdated
@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Jun 29, 2026
@jndlansh
jndlansh requested a review from JManion32 June 29, 2026 06:15
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Jun 29, 2026
Comment thread site/cypress/component/StatusBanner.cy.js Outdated
@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Jun 29, 2026
@JManion32

Copy link
Copy Markdown
Contributor

Please look into the failing Cypress (Feature) test. It is failing due to a bar-banner data-testid.

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

While I can't comment much on the design of the code and I'm sure Justin will have more insights on that front, I can verify that the status banners do work as intended. The component test is passing as well. I'll do a more in depth functional test once this PR is finalized. Looking good so far.

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

This looks good to me. I found one more component test that looks unnecessary. Other than that, great work!

Comment thread site/cypress/component/StatusBanner.cy.js Outdated

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

A few more comments, and then this should be good to go.

Comment thread site/vue/src/main.ts

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

Code looks good to me. I'd like to get a final approval from @JManion32 before merge though.

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

Code and functionality looks good to me. With the new infrastructure for capturing emits, components no longer depend on Submitty-specific state and we can avoid another refactor. The component tests adequately cover the new component, and I am happy about the component_test_utils.js file we added, which should help streamline the creation of future test files.

Great work Ansh!

@github-project-automation github-project-automation Bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development Jun 30, 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.

I retested this after the changes were made and the behavior is the same as main, working in both light mode and dark mode. I tested the behavior when resizing the screen and in a chromium based browser and in Firefox, all working as intended.

@bmcutler
bmcutler merged commit caf11ea into Submitty:main Jun 30, 2026
49 of 52 checks passed
jndlansh added a commit to jndlansh/Submitty that referenced this pull request Jul 1, 2026
…2941)

### Why is this Change Important & Necessary?

In this PR we set up the necessary infrastructure required for Vue
migration.
- Use props and emits in the Vue component.
- The Vue component should not deal with external DOM directly
- Just emit from the Vue component and our infrastructure will handle
this in Component mounting in twig.
- It uses an Events mapping in Twig file :
```
'events': {
    'color-change': '(event) => { document.body.style.background = event; }',
    'position-change': '(event) => { handlePositionChange(event.panelId, event.panelPosition); }',
}

```
**PLUS** 

In the ongoing migration of Submitty's UI from legacy Twig + jQuery to
Vue.js, in this PR we migrate the `StatusBanner` to vue.


### What is the New Behavior?
ErrorMessage.twig is replaced by StatusBanner.vue, a pure display
component that receives message and color as props
and emits color-change on mount so the parent can set the body
background color. The component renders a colored banner
in the TA grading panel header showing submission status (late, no
submission, withdrawn, overridden, etc.). No
  behavioral change, the banner looks and works identically.


https://github.com/user-attachments/assets/3c04f46a-32c4-4431-b744-cfe2e65200ec


### What steps should a reviewer take to reproduce or test the bug or
new feature?
1. Navigate to a TA grading page where the student has a submission
status condition (late, no submission, withdrawn,
  overridden grades, etc.)
2. Verify the colored banner appears in the grading panel header with
the correct message and background color
### Automated Testing & Documentation
- Added Cypress Component Testing.
<img width="490" height="397" alt="image"
src="https://github.com/user-attachments/assets/1d65c18d-6279-4a4c-8617-afb8a82cf8dc"
/>


### Other information

- Not a Breaking change
- No Migrations needed.

---------

Co-authored-by: Justin Manion <[email protected]>
prestoncarman added a commit that referenced this pull request Jul 1, 2026
* main: (78 commits)
  [Bugfix:TAGrading] Auto-open single file (#12625)
  [Feature:InstructorUI] Add sortable columns to manage students (#12957)
  [Dependency] Bump php-ds/php-ds from 1.7.0 to 2.0.1 in /site (#12827)
  [Refactor:TAGrading] Events Infrastructure & StatusBanner (#12941)
  [Dependency] Bump sqlalchemy from 2.0.48 to 2.0.51 in /.setup/pip (#12884)
  [Bugfix:Developer] trust hashicorp for vagrant install (#12968)
  [Feature:TAGrading] Backend for submission clustering (#12886)
  [Bugfix:InstructorUI] Missing Subsection in the Edit User form (#12955)
  [Bugfix:Submission] Warning Banners Accessibility Fix (#12956)
  [Bugfix:System] Preserve signup fields (#12939)
  [Bugfix:InstructorUI] Fix Csv Download of Subsections (#12954)
  [Bugfix:InstructorUI] Fix Manage Students Toggle Columns (#12953)
  [Feature:TAGrading] Persistent Auto-Open (#12931)
  [Bugfix:Submission] Dot File Upload (#12924)
  [Refactor:System] Declutter workers (#12815)
  [Bugfix:Developer] save/restore autograding_containers.json (#12952)
  [Bugfix:InstructorUI] Create Course Validation (#12949)
  [Testing:Notifications] Fix grade_inquiries.spec.js (#12950)
  [UI/UX:System] Add fullscreen button vue component (#12936)
  [Bugfix:TAGrading] Student Name Resize (#12946)
  ...

# Conflicts:
#	.pylintrc
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