Skip to content

[Refactor:TAGrading] Move markdownarea to vue#11872

Merged
bmcutler merged 24 commits intomainfrom
markdownarea-vue
Jul 22, 2025
Merged

[Refactor:TAGrading] Move markdownarea to vue#11872
bmcutler merged 24 commits intomainfrom
markdownarea-vue

Conversation

@lavalleeale
Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Currently markdownarea uses twig and therefore when it has to be rendered client-side for tagrading it uses twigjs which makes moving any code that interacts with it to vue far more difficult.

What is the New Behavior?

Markdownarea is moved to vuejs

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

Automated Testing & Documentation

Other information

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 20.58%. Comparing base (3b5f3ef) to head (aa2cf51).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #11872      +/-   ##
============================================
- Coverage     20.60%   20.58%   -0.02%     
+ Complexity     9279     9278       -1     
============================================
  Files           267      268       +1     
  Lines         35519    35539      +20     
  Branches        455      457       +2     
============================================
  Hits           7317     7317              
- Misses        27751    27769      +18     
- Partials        451      453       +2     
Flag Coverage Δ
autograder 21.34% <ø> (ø)
js 2.09% <0.00%> (-0.02%) ⬇️
migrator 100.00% <ø> (ø)
php 19.26% <ø> (+<0.01%) ⬆️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 88.88% <ø> (ø)

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.

@lavalleeale lavalleeale marked this pull request as draft July 11, 2025 17:08
@automateprojectmangement automateprojectmangement bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jul 11, 2025
@lavalleeale lavalleeale marked this pull request as ready for review July 15, 2025 19:34
@automateprojectmangement automateprojectmangement bot moved this from Work in Progress to Seeking Reviewer in Submitty Development Jul 15, 2025
Copy link
Copy Markdown
Contributor

@williamschen23 williamschen23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +30 to 48
success: function (res: string) {
const response = JSON.parse(res) as SolutionTaNotesResponse;
if (response.status === 'success') {
displaySuccessMessage('Solution has been updated successfully');
// Dom manipulation after the Updating/adding the solution note
$(`#solution-box-${component_id}`).attr('data-first-edit', 0);
$(`#solution-box-${component_id}`).attr('data-first-edit', '0');

// Updating the last edit info
$(`#solution-box-${component_id} .last-edit`).removeClass('hide');
$(`#solution-box-${component_id} .last-edit i.last-edit-time`).text(res.data.edited_at);
$(`#solution-box-${component_id} .last-edit i.last-edit-time`).text(response.data.edited_at);
$(`#solution-box-${component_id} .last-edit i.last-edit-author`).text(
res.data.current_user_id === res.data.author ? `${res.data.author} (You)` : res.data.author,
response.data.current_user_id === response.data.author ? `${response.data.author} (You)` : response.data.author,
);

$(`#solution-box-${component_id}`).find('.solution-cont')
.attr('data-original-solution', $(`#textbox-solution-${component_id}`).val());
.attr('data-original-solution', ($(`#textbox-solution-${component_id}`).val() as string ?? ''));

const save_button = $(`#solution-box-${component_id}`).find('.solution-save-btn');
save_button.prop('disabled', true);
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.

can we avoid jquery here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #11885

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jul 17, 2025
@automateprojectmangement automateprojectmangement bot moved this from Work in Progress to In Review in Submitty Development Jul 17, 2025
Copy link
Copy Markdown
Contributor

@williamschen23 williamschen23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality reviews:
When clicking "preview", the insert markdown buttons don't disappear
When refreshing the forums, the toggle button does not stick

@github-project-automation github-project-automation bot moved this from In Review to Work in Progress in Submitty Development Jul 21, 2025
Copy link
Copy Markdown
Contributor

@williamschen23 williamschen23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/user-attachments/assets/774ecf90-12d1-4317-be12-c14545b5cd3
I think this is the last thing, I don't have any problems with the code.
The forum new thread markdown renders weirdly

Copy link
Copy Markdown
Contributor

@williamschen23 williamschen23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every markdown box that changes in the PR works. The way the the markdown box is rendered in the code is pretty clear. The v-html is safe as it comes from twig, which automatically escapes dangerous elements

@github-project-automation github-project-automation bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development Jul 22, 2025
@bmcutler bmcutler merged commit ad4f378 into main Jul 22, 2025
46 of 48 checks passed
@bmcutler bmcutler deleted the markdownarea-vue branch July 22, 2025 19:30
bmcutler pushed a commit that referenced this pull request Jul 28, 2025
### Why is this Change Important & Necessary?
<!-- Include any GitHub issue that is fixed/closed using "Fixes
#<number>" or "Closes #<number>" syntax.
Alternately write "Partially addresses #<number>" or "Related to
#<number>" as appropriate. -->
This moves the first tagrading panel to vue.

### What is the New Behavior?
<!-- Include before & after screenshots/videos if the user interface has
changed. -->
Solution notes is rendered with vue and the twig + separate scripts are
removed.

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

### Automated Testing & Documentation
<!-- Is this feature sufficiently tested by unit tests and end-to-end
tests?
If this PR does not add/update the necessary automated tests, write a
new GitHub issue and link it below.
Is this feature sufficiently documented on submitty.org?
Link related PRs or new GitHub issue to update documentation. -->

### Other information
<!-- Is this a breaking change?  
Does this PR include migrations to update existing installations?  
Are there security concerns with this PR? -->
This is meant to be merged after #11872
bmcutler pushed a commit that referenced this pull request Oct 3, 2025
### Why is this Change Important & Necessary?
Resolves #12068 
Markdown toggle on Forum replies does not function correctly (see issue
for more details).
Also, toggling markdown may erase the contents of the text box in
certain cases.
Bug introduced by Vue refactor #11872 where markdown toggle logic is
moved to cookie

### What is the New Behavior?
Vue component has been updated to directly read+write to original HTML
form input, removed unnecessary cookie
Markdown fields without toggle functionality are preserved

It is worth investigating to find a better solution for propagating Vue
state updates to outer DOM in the future.
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.

3 participants