Skip to content
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

General: Fix scroll to section when clicking status bar in exercise update view #9243

Conversation

florian-glombik
Copy link
Contributor

@florian-glombik florian-glombik commented Aug 23, 2024

Checklist

General

Client

Motivation and Context

When using the scroll functionality from the formStatusBar in the programming exercise update view (create/edit/import) the page scrolls too far, so the headline will not be seen.

This PR fixes the scrolling, so now the headline of the section will be finished when the scrolling is done.

Description

  • Fixing the scroll position so the headline will now be visible when the scrolling is finished
  • Using an animation for the scrolling to improve the user experience
  • Added an e2e test that checks if the headline is visible after the scrolling is done
  • Fixing the formStatusBar for Safari (was broken before, the formStatusBar disappeared after using it to scroll to a section)
  • reducing the size of the circle around the checkmark in the statusbar
  • centering the checkmark in the statusbar
  • fixing calculation of navbar height for Safari (was broken before, previous solution casted to a value that does not exist on Safari)
  • fixing calculation in general (instead of adding magic numbers that do not even reflect the actual component offsets)

Steps for Testing

  • 1 Instructor
  1. Go to the create/edit/import view of an exercise
  2. Use the formStatusBar to scroll down to a section (e.g. Problem)
  3. Verify that the headline of the section is visible after the scrolling is done
  4. Use the formStatusBar to scroll up to a section (e.g. General)
  5. Verify that the headline of the section is visible after the scrolling is done
  6. (If you are testing on Safari, verify that the formStatusBar did not disappear after clicking a section)

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

old (broken version)

Headline not visible after scroll
StatusBarbrokenChrome

Safari

The FormStatusBar disappears

StatusBarbrokenSafari

new (fixed version)

Headline visible after scroll
fixingScrollingToSection

Safari

The FormStatusBar does not disappear anymore

fixingScrollingToSectionSafari

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced the form status bar with uniquely identifiable sections for improved navigation and accessibility.
    • Improved scrolling behavior for better visibility of section headlines during navigation within the form.
    • Added manual change detection to the modeling exercise update component for improved UI responsiveness.
  • Refactor

    • Streamlined component lifecycle management and consolidated dynamic styling logic, improving maintainability and performance.
    • Introduced a utility function for better management of header height based on navbar dimensions.
  • Tests

    • Updated imports for components to reflect new structured paths, enhancing code organization.

@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Aug 23, 2024
@florian-glombik florian-glombik changed the title Bugfix/programming exercises/scroll to headline from scroll status bar Programming exercises: Fix scroll to headline from scroll status bar Aug 23, 2024
@florian-glombik florian-glombik marked this pull request as ready for review August 23, 2024 01:19
@florian-glombik florian-glombik requested a review from a team as a code owner August 23, 2024 01:19
Copy link

coderabbitai bot commented Aug 23, 2024

Walkthrough

The updates include modifications to the FormStatusBarComponent, ChecklistCheckComponent, and their associated tests, as well as the introduction of a new utility function for header height management. Key changes consist of enhancing accessibility in the HTML, removing certain lifecycle methods in TypeScript, updating import paths for improved organization, refining conditional rendering logic in templates, and adding manual change detection in the ModelingExerciseUpdateComponent.

Changes

Files Change Summary
src/main/webapp/app/forms/form-status-bar/form-status-bar.component.html, src/main/webapp/app/forms/form-status-bar/form-status-bar.component.scss, src/main/webapp/app/forms/form-status-bar/form-status-bar.component.ts Enhanced accessibility with indexed sections in HTML, reduced size of status circle in styles, and simplified dynamic header height management in TypeScript.
src/main/webapp/app/shared/components/checklist-check/checklist-check.component.html, src/main/webapp/app/shared/components/checklist-check/checklist-check.component.scss, src/main/webapp/app/shared/components/checklist-check/checklist-check.component.ts Consolidated conditional rendering logic for icons, added font-size for unchecked items, and changed FontAwesome icons' access level from public to protected.
src/main/webapp/app/shared/components/shared-component.module.ts, src/test/javascript/spec/component/exam/manage/exams/exam-checklist-exercisegroup-table.component.spec.ts, src/test/javascript/spec/component/exam/manage/exams/exam-detail.component.spec.ts, src/test/javascript/spec/component/tutorial-groups/tutorial-groups-management/tutorial-groups-checklist.component.spec.ts Updated import paths for ChecklistCheckComponent to reflect new directory structure, improving organization.
src/main/webapp/app/exercises/modeling/manage/modeling-exercise-update.component.ts Added ChangeDetectorRef to manage manual change detection, ensuring UI updates reflect the latest state of the component's data.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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

@florian-glombik florian-glombik changed the title Programming exercises: Fix scroll to headline from scroll status bar Programming exercises: Fix scroll to section when clicking status bar Aug 23, 2024
Copy link

@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: 3

Outside diff range comments (1)
src/test/javascript/spec/component/forms/form-status-bar.component.spec.ts (1)

Line range hint 1-30: Consider re-adding a basic initialization test.

While the focus is on core functionality, a basic test to ensure the component initializes correctly can be beneficial for catching setup issues early.

Consider re-adding a simple test like:

it('should create', () => {
    expect(comp).toBeDefined();
});

pzdr7
pzdr7 previously approved these changes Sep 2, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

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

Code

JohannesWt
JohannesWt previously approved these changes Sep 2, 2024
Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

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

Code 👍

…adline-from-scroll-status-bar

# Conflicts:
#	src/test/javascript/spec/component/exam/manage/exams/exam-detail.component.spec.ts
Copy link

@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 again on TS1 on Safari, works 👍

Copy link
Contributor

@Jan-Thurner Jan-Thurner left a comment

Choose a reason for hiding this comment

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

Reaprove after merge conflict. Still works on Arc.

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Reapprove after merge conflict

Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

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

Reapprove Code 👍

@krusche krusche merged commit fc447f6 into develop Sep 6, 2024
17 of 21 checks passed
@krusche krusche deleted the bugfix/programming-exercises/scroll-to-headline-from-scroll-status-bar branch September 6, 2024 21:32
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!) playwright ready for review ready to merge tests user interface
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.