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

Communication: Reduce FAQ size #9568

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

cremertim
Copy link
Contributor

@cremertim cremertim commented Oct 23, 2024

Checklist

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.

Steps for Testing

Motivation and Context

Currently, the UI is quite overwhelming

Description

I reduced the font size of the question and the title

Prerequisites:

  • 1 Instructor
  • 1 Course with FAQ enabled
  1. Log in to Artemis
  2. Navigate to Course Overview
  3. Click on FAQs
  4. See the new UI

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

image
Old UI

image
New UI

@cremertim cremertim requested a review from a team as a code owner October 23, 2024 13:53
@cremertim cremertim self-assigned this Oct 23, 2024
@cremertim cremertim requested a review from rabeatwork October 23, 2024 13:53
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 23, 2024
Copy link

coderabbitai bot commented Oct 23, 2024

Walkthrough

The pull request includes modifications to the HTML and CSS of the FAQ components within the application. Changes to the course-faq-accordion.component.html streamline the structure by adjusting heading levels and simplifying the rendering of answers. The CSS for the accordion component is updated by removing the gap property from the .badge-container class. Additionally, the course-faq.component.html file sees an adjustment to the margin styling of an <hr> element, while maintaining existing functionality.

Changes

File Path Change Summary
src/main/webapp/app/overview/course-faq/course-faq-accordion.component.html Changed question title from <h2> to <h5>, removed <h4> wrapper for answers, and removed class mb-0.
src/main/webapp/app/overview/course-faq/course-faq-accordion.component.scss Removed gap property from .badge-container.
src/main/webapp/app/overview/course-faq/course-faq.component.html Added classes mb-1 mt-1 to <hr> for margin styling adjustments.

Possibly related PRs

Suggested labels

client, ready for review, small, component:Communication

Suggested reviewers

  • SimonEntholzer
  • krusche
  • rabeatwork
  • edkaya

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>, please review it.
    • 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 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 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.

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

🧹 Outside diff range and nitpick comments (2)
src/main/webapp/app/overview/course-faq/course-faq.component.html (2)

Line range hint 13-27: Enhance accessibility and performance of the filter dropdown

Consider the following improvements:

  1. Add proper ARIA attributes to checkbox menu items for better screen reader support
  2. Optimize the track function in @for loop to use unique identifiers
 <ul ngbDropdownMenu class="checkbox-menu text-nowrap pe-2" aria-labelledby="filter-dropdown-button">
-    @for (category of existingCategories; track category) {
+    @for (category of existingCategories; track category.category) {
         <li>
-            <label class="d-flex align-items-center">
+            <label class="d-flex align-items-center" role="menuitemcheckbox" [attr.aria-checked]="activeFilters.has(category.category!)">
                 <input
                     id="filter-{{ category.category }}"
                     class="ms-2 form-check-input"
                     (change)="toggleFilters(category.category!)"
                     [checked]="activeFilters.has(category.category!)"
                     type="checkbox"
+                    aria-label="Filter by {{category.category}}"
                 />

Line range hint 35-37: Optimize FAQ list rendering performance

Consider using a unique identifier for tracking FAQ items instead of the entire object.

-    @for (faq of this.filteredFaqs; track faq) {
+    @for (faq of this.filteredFaqs; track faq.id) {
         <jhi-course-faq-accordion [faq]="faq"></jhi-course-faq-accordion>
     }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c17b2c4 and 34d91e5.

📒 Files selected for processing (3)
  • src/main/webapp/app/overview/course-faq/course-faq-accordion.component.html (1 hunks)
  • src/main/webapp/app/overview/course-faq/course-faq-accordion.component.scss (0 hunks)
  • src/main/webapp/app/overview/course-faq/course-faq.component.html (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/webapp/app/overview/course-faq/course-faq-accordion.component.scss
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/overview/course-faq/course-faq-accordion.component.html (1)

Pattern 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/overview/course-faq/course-faq.component.html (1)

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

🔇 Additional comments (5)
src/main/webapp/app/overview/course-faq/course-faq-accordion.component.html (3)

6-8: LGTM! Proper usage of new Angular syntax.

The code correctly uses the new @for syntax with proper tracking, adhering to the latest Angular guidelines.


11-11: Verify XSS protection in markdown processing.

While using innerHTML with a markdown pipe is common, ensure the htmlForMarkdown pipe implements proper sanitization to prevent XSS attacks.

#!/bin/bash
# Search for the markdown pipe implementation to verify sanitization
ast-grep --pattern 'class $_ implements PipeTransform {
  $$$
  transform($_) {
    $$$
  }
}'

3-3: Verify heading hierarchy in the page context.

Changing from <h2> to <h5> might affect the document outline and accessibility. Ensure this heading level is appropriate within the broader page context.

✅ Verification successful

The previous script execution seems to have returned results for a different query (showing pipe transformers) instead of heading elements. Let me try again with a more specific search for headings in the overview directory.


Based on the search results, I can now analyze the heading hierarchy in the overview section. The FAQ component's heading level change from h2 to h5 appears to be appropriate because:

  1. The FAQ question title is part of an accordion item, which is a sub-component of the larger FAQ section
  2. The parent components use appropriate higher-level headings:
    • Course title uses h3 in header-course.component.html
    • Main section headings use h2/h3 (e.g., in course-statistics.component.html)
    • Other accordion-style or card components also use h5 for similar content (e.g., course-tutorial-group-card.component.html)

The heading level change from h2 to h5 is semantically correct.

The h5 heading is appropriately used for this accordion item content as it maintains proper document outline hierarchy, where parent components use higher-level headings (h2-h4) for main sections, and h5 is used for nested, lower-level content like accordion items.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for heading elements in related components to verify hierarchy
rg -A 1 "<h[1-6]" src/main/webapp/app/overview/

Length of output: 3129


Script:

#!/bin/bash
# Search for heading elements in the overview directory and its subdirectories
rg -l "<h[1-6]" src/main/webapp/app/overview/

# For files that contain headings, show the content with context
rg -A 2 -B 2 "<h[1-6]" src/main/webapp/app/overview/

Length of output: 58928

src/main/webapp/app/overview/course-faq/course-faq.component.html (2)

29-29: LGTM: Consistent margin spacing added

The addition of margin classes provides balanced spacing around the horizontal rule, improving visual consistency.


Line range hint 8-27: LGTM: Proper usage of new Angular control flow syntax

The template correctly implements the new Angular control flow syntax (@if, @for) throughout, adhering to the coding guidelines.

Also applies to: 31-40

Copy link
Contributor

@rabeatwork rabeatwork left a comment

Choose a reason for hiding this comment

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

Thank you 🙏🏼

Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test4.artemis.cit.tum.de" is already in use by PR #9553.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Oct 23, 2024
@cremertim cremertim removed the deployment-error Added by deployment workflows if an error occured label Oct 23, 2024
@Malekos74 Malekos74 temporarily deployed to artemis-test3.artemis.cit.tum.de October 23, 2024 19:38 — with GitHub Actions Inactive
Copy link

@Malekos74 Malekos74 left a comment

Choose a reason for hiding this comment

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

Server tested on: Server 3

Great change, it's way better now

Minor notice:
On massive screen, the text is too small, maybe increase it's size

image

Copy link

@sachmii sachmii 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 way better with this change. Thank you :)

Copy link

@Cathy0123456789 Cathy0123456789 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 a lot better than before, thank you!

Minor notice: It seems like the first FAQ has less space to the top line than others (they look slightly better because they look more centered)
image

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!) maintainer-approved The feature maintainer has approved the PR ready to merge
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants