Visual cues improvements
Description
- Added new option in settings to allow user to specify whether they would like to hover to see the start/due dates of assessments (new field called
hover_assessment_datefor users) - Modify clearfix to adjust based on window size
- Added start/due dates on the course index page for current assignments
Motivation and Context
Addresses #2031
How Has This Been Tested?
- Go to account settings, click to toggle and see that due dates are now only visible on hover
- Dates shown on course index page
- Clearfix before:
- Clearfix after:
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I have run rubocop and erblint for style check. If you haven't, run
overcommit --install && overcommit --signto use pre-commit hook for linting - [ ] My change requires a change to the documentation, which is located at Autolab Docs
- [ ] I have updated the documentation accordingly, included in this PR
Walkthrough
Walkthrough
The recent update enhances the user interface and experience related to assessments, focusing on display settings and date visibility. A key feature is the introduction of hover_assessment_date, enabling users to view assessment dates on hover, now configurable in user profiles. The update includes layout adjustments for assessments, improved styling for date display, and backend support for these features, including a new database migration to add the hover_assessment_date field to users.
Changes
| File(s) | Change Summary |
|---|---|
app/controllers/users_controller.rbapp/views/users/show.html.erb |
Added @hover_assessment_date assignment; introduced update_display_settings method with authorization and logic; included JavaScript for hover_assessment_date handling and display settings form. |
app/views/assessments/index.html.erbapp/views/courses/index.html.erb |
Enhanced layout management with JavaScript for layout adjustments, conditional classes, and hover effects on assessment items; added assessment_date styling; modified link_to blocks for assessments. |
db/migrate/20240226083719_add_hover_assessment_date_to_users.rbdb/schema.rb |
Added migration for hover_assessment_date boolean column in users table; updated schema with new field. |
app/assets/stylesheets/_variables.scssapp/assets/stylesheets/assessment_date.scssapp/assets/stylesheets/assessments.scss |
Introduced $autolab-gray-text variable; added styles for date elements and refined hover effects in stylesheets. |
config/routes.rb |
Added update_display_settings route using PATCH method for adjusting user settings. |
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?
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-tests for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit tests for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin 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 tests. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
-
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 as PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
Could you figure out a way for the due date hover that there exists a buffer between the rows so that when you go to hover on a due date, it doesn't push the rows below it down? Right now hovering on an asmt pushes everything down if the category column is the longest one
The clearfix "fix" don't seem to be working, seems to cause cards to get inserted in spaces where they shouldn't, instead of clean separation:
Before:
After: