Skip to content

Conversation

@HawKhiem
Copy link
Contributor

@HawKhiem HawKhiem commented Jan 24, 2026

Checklist

General

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding guidelines.
  • I strictly followed the AET UI-UX guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with LocalVC and Jenkins.

Motivation and Context

The "Info Text" at the top of the markdown editor was adding extra height that wasn't being accounted for when the editor was in externalHeight mode (e.g., in the Instructor Code Editor). This caused the editor wrapper to inherit the full height of the container plus the info text, pushing the file upload footer out of the visible viewport.

Description

This PR fixes the layout overflow issue by converting the markdown editor container to a Flexbox column.

  • HTML: The outer container now uses d-flex flex-column. The Info Text is set to flex-shrink-0, and the wrapper is set to flex-grow-1. This ensures the wrapper automatically fills only the remaining space.
  • TypeScript: Updated getEditorHeight() to measure this.wrapper instead of this.fullElement. Since the wrapper is now correctly sized by Flexbox, this measurement inherently mimics the "available space" correctly, ensuring the internal Monaco instance sizes itself well within the boundaries.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Section with Markdown Editor enabled (e.g., Problem Statement in Code Editor)
  1. Log in to Artemis as an Instructor.
  2. Navigate to a Programming Exercise.
  3. Open the Editor (Edit in Editor).
  4. Observe the "Problem Statement" editor on the left (or right, depending on layout).
  5. Verify that the "Info Text" (blue help text) is visible at the top.
  6. Verify that the "Upload files" footer is fully visible at the bottom of the editor area and not pushed off-screen.
  7. Attempt to resize the browser or the split pane to ensure the footer stays visible.

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Lines Expects Ratio
markdown-editor-monaco.component.ts 97.50% 523 46 8.8

Last updated: 2026-01-27 20:54:29 UTC

Screenshots

Summary by CodeRabbit

  • Bug Fixes
    • Improved markdown editor layout by switching to a vertical flex arrangement for stable header, content, and footer alignment.
    • Adjusted height handling so the editor wrapper reliably fills available space and falls back to auto when appropriate.
    • Prevented negative editor heights by clamping calculated values to a non-negative minimum.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Jan 24, 2026
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jan 24, 2026
@HawKhiem HawKhiem changed the title Fix integrated-markdown-editor: Fix upload footer layout in markdown … Integrated markdown editor: Integrated markdown editor: Fix upload footer layout overflow Jan 24, 2026
@github-actions
Copy link

@HawKhiem Test coverage has been automatically updated in the PR description.

@HawKhiem HawKhiem changed the title Integrated markdown editor: Integrated markdown editor: Fix upload footer layout overflow Integrated markdown editor: Fix upload footer layout overflow Jan 24, 2026
@HawKhiem HawKhiem linked an issue Jan 24, 2026 that may be closed by this pull request
@HawKhiem HawKhiem added ready for review programming Pull requests that affect the corresponding module labels Jan 24, 2026
@HawKhiem HawKhiem marked this pull request as ready for review January 24, 2026 22:52
@HawKhiem HawKhiem requested a review from krusche as a code owner January 24, 2026 22:52
@github-actions
Copy link

@HawKhiem Test coverage has been automatically updated in the PR description.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Walkthrough

Refactors the markdown editor to use a vertical flex layout and unifies editor height calculation to derive from the wrapper element, with clamped non-negative heights and string-based height binding (px or auto).

Changes

Cohort / File(s) Summary
Monaco Markdown Editor Template
src/main/webapp/app/shared/markdown-editor/monaco/markdown-editor-monaco.component.html
Converted root to d-flex flex-column; made info text flex-shrink-0; made wrapper flex-grow-1; changed height binding to return 'NNNpx' or 'auto' instead of numeric px binding.
Monaco Markdown Editor Height Logic
src/main/webapp/app/shared/markdown-editor/monaco/markdown-editor-monaco.component.ts
getEditorHeight() now always uses wrapper clientHeight and clamps result with Math.max(0, ...), removing the previous conditional between fullElement and wrapper.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing layout overflow in the markdown editor's upload footer by restructuring the component to use Flexbox.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/integrated-markdown-editor/fix-footer-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@src/main/webapp/app/shared/markdown-editor/monaco/markdown-editor-monaco.component.ts`:
- Around line 517-522: getEditorHeight currently subtracts footer and palette
heights (using this.getElementClientHeight on this.wrapper,
this.fileUploadFooter, this.actionPalette) and then subtracts
BORDER_HEIGHT_OFFSET which can produce negative values in small containers;
update getEditorHeight to clamp the computed height to a minimum of 0 (e.g. use
Math.max(0, computedHeight)) before returning so Monaco never receives a
negative size.

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Jan 24, 2026
@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de January 24, 2026 22:57 Inactive
@github-actions github-actions bot removed the programming Pull requests that affect the corresponding module label Jan 24, 2026
@github-actions
Copy link

@HawKhiem Test coverage has been automatically updated in the PR description.

@HawKhiem HawKhiem added the programming Pull requests that affect the corresponding module label Jan 24, 2026
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 898ms
TestResultTime ⏱
No test annotations available

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de January 24, 2026 23:19 Inactive
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran221 passed1 skipped1 failed1h 43m 40s 48ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/test-exam/TestExamStudentExams.spec.ts
ts.Test Exam - student exams › Check exam participants and their submissions › Search for a student in exams❌ failure7m 8s 851ms

Copy link
Contributor

@florian-glombik florian-glombik left a comment

Choose a reason for hiding this comment

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

Code

@github-actions github-actions bot removed the programming Pull requests that affect the corresponding module label Jan 25, 2026
@github-actions
Copy link

@HawKhiem Test coverage has been automatically updated in the PR description.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran220 passed1 skipped2 failed1h 45m 4s 403ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/test-exam/TestExamParticipation.spec.ts
ts.Test exam participation › Early Hand-in › Using exercise sidebar to navigate within exam❌ failure4m 20s 721ms
ts.Test exam participation › Early Hand-in › Using exercise overview to navigate within exam❌ failure4m 53s 262ms

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de January 26, 2026 01:04 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de January 27, 2026 10:01 Inactive
Copy link
Contributor

@sawys777 sawys777 left a comment

Choose a reason for hiding this comment

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

Reviewed code and tested on TS4

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de January 27, 2026 13:58 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de January 27, 2026 14:12 Inactive
Copy link
Member

@anian03 anian03 left a comment

Choose a reason for hiding this comment

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

Tested on TS6. The file upload footer was visible again in the exercise problem statement editor, and I could also not see any sizing issues anywhere else, e.g. communication or exam texts. When resizing, the text adapted to the available space and did not cause overflow issues.

Copy link

@atharvamp atharvamp left a comment

Choose a reason for hiding this comment

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

Tested on TS6, everything works as intended. After resizing, the text is still visible. Tested on Safari and Chrome.

@Gavlitskii Gavlitskii temporarily deployed to artemis-test1.artemis.cit.tum.de January 27, 2026 15:47 — with GitHub Actions Inactive
@Gavlitskii Gavlitskii had a problem deploying to artemis-test9.artemis.cit.tum.de January 27, 2026 16:06 — with GitHub Actions Failure
@Gavlitskii Gavlitskii temporarily deployed to artemis-test5.artemis.cit.tum.de January 27, 2026 16:27 — with GitHub Actions Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de January 27, 2026 20:48 Inactive
@github-actions
Copy link

@HawKhiem The "ready to merge" label was removed because the PR is not yet ready:

Unchecked Tasks (1)

  • Test 1

To resolve:

  • Check all task checkboxes in the PR description (both Checklist and Review Progress sections)

Once resolved, you can re-add the "ready to merge" label.

@github-actions
Copy link

@HawKhiem Your PR description needs attention before it can be reviewed:

Issues Found

  1. Screenshots are missing but this PR contains visual/UI changes

How to Fix

  • Include screenshots of the UI changes.

This check validates that your PR description follows the PR template. A complete description helps reviewers understand your changes and speeds up the review process.

Note: This description validation is an experimental feature. If you observe false positives, please send a DM with a link to the wrong comment to Patrick Bassner on Slack. Thank you!

Copy link

@maxgutke maxgutke left a comment

Choose a reason for hiding this comment

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

I tested this PR on TS1. Everything works as expected

@github-actions
Copy link

@HawKhiem Test coverage has been automatically updated in the PR description.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report223 ran222 passed1 skipped0 failed1h 30m 37s 340ms
TestResultTime ⏱
No test annotations available

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de January 28, 2026 08:02 Inactive
Copy link

@lana-ati lana-ati left a comment

Choose a reason for hiding this comment

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

Tested during working session on TS1. Worked as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix client Pull requests that update TypeScript code. (Added Automatically!) ready for review

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

Integrated markdown editor: Fix upload footer layout overflow

9 participants