Skip to content

Mobile apps: Unify padding for problem statement components #10986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

anian03
Copy link
Member

@anian03 anian03 commented Jun 4, 2025

Checklist

General

  • I tested all changes and their related features with all corresponding user types on a test server.
  • This is a small issue that I tested locally and was confirmed by another developer on a test server.
  • I chose a title conforming to the naming conventions for pull requests.

Client

  • 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.
  • I added multiple screenshots/screencasts of my UI changes.

Motivation and Context

The mobile apps display problem statements for exercises using a separate problem statement component. This component however includes padding for programming exercises and no padding for other exercise types. This makes at least one of the types of exercises always look different from the other ones in the mobile apps.

Description

By adding padding to the non-programming exercise problem statements, we ensure that all types of problem statements appear with the same amount of padding (1rem).

Steps for Testing

Prerequisites:

  • 1 Programming exercise
  • 1 other exercise (not quiz)
  1. Navigate to the programming exercise using e.g. the iOS app
  2. Navigate to the other exercise
  3. Ensure that both have padding around the problem statement.
  4. In the web app, nothing should have changed.

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

Screenshots

Screenshots compare programming and text exercise – different (missing) padding can be observed. After this PR, all types should look like the programming exercise in terms of padding.

Old text exercise Programming exercise

Summary by CodeRabbit

  • New Features
    • The problem statement view now adapts its layout based on context, providing improved padding or margin depending on whether it is displayed standalone (such as in mobile apps) or within the regular interface. This enhances readability and user experience across different platforms.

@anian03 anian03 self-assigned this Jun 4, 2025
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Jun 4, 2025
@anian03 anian03 changed the title Mobile apps : Unify padding for problem statement components Mobile apps: Unify padding for problem statement components Jun 4, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module labels Jun 4, 2025
@anian03 anian03 added the small label Jun 4, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de June 4, 2025 21:40 Inactive
Copy link

github-actions bot commented Jun 4, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed57m 13s 39ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 17s 796ms

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de June 4, 2025 22:38 Inactive
@anian03 anian03 marked this pull request as ready for review June 4, 2025 22:44
@anian03 anian03 requested a review from krusche as a code owner June 4, 2025 22:44
Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Walkthrough

The changes introduce a new isStandalone property to the problem statement component, determined by analyzing the current route. The component's container now conditionally applies padding or margin classes based on this property, adjusting its appearance when displayed in standalone contexts.

Changes

File(s) Change Summary
src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.html Conditional class binding for container: uses p-3 if isStandalone is true, otherwise uses mb-2.
src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts Imports NgClass, adds isStandalone property, sets it based on route URL segments in ngOnInit.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Router
    participant ProblemStatementComponent

    User->>Router: Navigates to problem statement route
    Router->>ProblemStatementComponent: Initializes component
    ProblemStatementComponent->>Router: Subscribes to route parameters and URL
    Router-->>ProblemStatementComponent: Provides URL segments
    ProblemStatementComponent->>ProblemStatementComponent: Sets isStandalone based on URL
    ProblemStatementComponent->>ProblemStatementComponent: Renders container with conditional classes
Loading

Suggested labels

ready for review

Suggested reviewers

  • krusche
  • Predixx
  • chuuuun

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-04T23_00_50_056Z-debug-0.log


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa1d020 and efa8206.

📒 Files selected for processing (1)
  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build .war artifact
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee6d6e3 and fa1d020.

📒 Files selected for processing (2)
  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.html (1 hunks)
  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/main/webapp/**/*.html`: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.html
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalC...

src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

  • src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts
🧬 Code Graph Analysis (1)
src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts (1)
src/test/javascript/spec/helpers/mocks/mock-router.ts (1)
  • url (27-29)
🪛 GitHub Check: client-style
src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts

[warning] 48-48:
'url' is never reassigned. Use 'const' instead

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.html (1)

7-7: LGTM! Conditional styling correctly implements mobile app padding.

The ngClass binding properly applies padding (p-3) for standalone mobile contexts while maintaining the existing margin (mb-2) for web contexts, which aligns perfectly with the PR objectives.

src/main/webapp/app/core/course/overview/exercise-details/problem-statement/problem-statement.component.ts (1)

2-2: LGTM! NgClass import correctly added.

The NgClass directive import and module registration are properly implemented to support the conditional styling in the template.

Also applies to: 17-17

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Jun 4, 2025
Copy link

github-actions bot commented Jun 4, 2025

End-to-End (E2E) Test Results Summary

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

Copy link

github-actions bot commented Jun 4, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran197 passed3 skipped1 failed59m 8s 988ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 15s 601ms

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de June 5, 2025 09:59 Inactive
Copy link

@HawKhiem HawKhiem 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 TS3 and Ipad. Worked as described

Copy link

@nils-jansen nils-jansen left a comment

Choose a reason for hiding this comment

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

Code

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de June 11, 2025 21:15 Inactive
Copy link
Contributor

@eylulnc eylulnc 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 TS4, looks good

@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de June 13, 2025 07:45 Inactive
Copy link
Contributor

@PaRangger PaRangger 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 TS2. Code LGTM. 😄

@anian03 anian03 moved this from Ready For Review to Developer Approved in Artemis Development Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module ready for review small user interface
Projects
Status: Developer Approved
Development

Successfully merging this pull request may close these issues.

5 participants