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

Notes Basic Frontend #960

Merged
merged 11 commits into from
Nov 15, 2024
Merged

Notes Basic Frontend #960

merged 11 commits into from
Nov 15, 2024

Conversation

nidhi-mylavarapu
Copy link
Contributor

@nidhi-mylavarapu nidhi-mylavarapu commented Nov 7, 2024

Summary

This pull request is the first step towards implementing the Notes Feature!

  • Added notes option to Course Card Menu with appropriate icon
  • Created Note component and added note for every course card that slides out on selection and slides back in after clicking on arrow icon

Remaining TODOs:

  • Align the Note text + note icon in the course card menu
  • Get correct color mapping for course card color + lighter note color
  • I think Joanna was looking at alternative icons for notes so we may need to replace the current one.
  • Add the sliding note card only when the note option is selected from the menu
  • Adjust shadows / CIS to it's more exact - I don't think the margins are exactly the same as the Figma (but also the actual Course Cards are different dimensions in the designs so not sure what to change)
  • expanded note card should make everything under it shift downward
  • add arrow hover state

Test Plan

Add a course card and select the note that peeks out from under the card. Type something, click the arrow to slide the note back under the card.

  • make sure that the course card has a peeking note under it that is a lighter version of the course card color.
  • if you change the color of the course card, the note changes color too
  • after the note is expanded, it can only collapse after clicking the arrow icon (ask Joanna about all ways to expand the note + collapse note)

@dti-github-bot
Copy link
Member

dti-github-bot commented Nov 7, 2024

[diff-counting] Significant lines: 215.

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Visit the preview URL for this PR (updated for commit ba9c44d):

https://cornelldti-courseplan-dev--pr960-nidhi-notes-basic-fr-54t1r1qe.web.app

(expires Sat, 14 Dec 2024 16:59:23 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 6d4e0437c4559ed895272bbd63991394f1e0e933

@nidhi-mylavarapu nidhi-mylavarapu marked this pull request as ready for review November 7, 2024 17:54
@nidhi-mylavarapu nidhi-mylavarapu requested a review from a team as a code owner November 7, 2024 17:54
<div class="courseMenu-left">
<img
class="courseMenu-icon"
src="@/assets/images/noteIconSmall.svg"
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we might change the image, but I believe the icon is a bit bigger than the other icons so it looks unaligned

Copy link
Member

Choose a reason for hiding this comment

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

Yes that is the case, we'd have to rearrange all the icons sidebar style to be centered not right-aligned and have a grid or dynamic offset calculation otherwise — I'd just find a new icon honestly.

Copy link
Member

@Destaq Destaq left a comment

Choose a reason for hiding this comment

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

Nice work! A couple smaller issues, but should be good to branch off of for additional fixes and animations.

Copy link
Member

Choose a reason for hiding this comment

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

We might want to make a transparent version of this SVG that then gets filled with the color appropriate for that course note color, as otherwise would need a set of half-a-dozen-plus various arrow SVG icons for all the possible course colors.

@close-edit-color="closeEditColorModal"
v-if="isEditColorOpen"
/>
<div class="course-container">
Copy link
Member

Choose a reason for hiding this comment

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

I know it was my suggestion to rearrange, but I would just be careful with the class names here post-reshuffling. It looks like the CSS logic for some of the z-indices gets in a kerfuffle on account of this change, causing the modal to be hidden under the next course card.

image

An easy fix would be to reduce the z-index from 1 to 0 for the course card. Can be a part of the scope of frontend fixes branched off this PR.

<course-caution
v-if="!isReqCourse && compact"
v-if="!isReqCourse && !isSchedGenCourse"
Copy link
Member

Choose a reason for hiding this comment

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

Just for reference could you explain what this change was motivated by? Doesn't look immediately relevant to the notes feature.

@open-save-course-modal="openSaveCourseModal"
:getCreditRange="getCreditRange || []"
v-click-outside="closeMenuIfOpen"
<Note
Copy link
Member

Choose a reason for hiding this comment

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

Wow great work figuring out all of this tricky CSS stuff!

.course {
box-shadow: 0px 0px 10px 4px rgba(0, 0, 0, 0.055);
position: relative;
z-index: 1;
Copy link
Member

Choose a reason for hiding this comment

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

This is the z-index I was referencing previously — seems to mess with the course menu dropdown precedence.

<div class="courseMenu-left">
<img
class="courseMenu-icon"
src="@/assets/images/noteIconSmall.svg"
Copy link
Member

Choose a reason for hiding this comment

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

Yes that is the case, we'd have to rearrange all the icons sidebar style to be centered not right-aligned and have a grid or dynamic offset calculation otherwise — I'd just find a new icon honestly.

@@ -250,6 +260,9 @@ export default defineComponent({
}
return creditArray;
},
openNoteModal(courseCode: string) {
this.$emit('open-note-modal');
Copy link
Member

Choose a reason for hiding this comment

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

NB: checks not relevant as this will be used in later PRs.

<img
src="@/assets/images/notes/arrow.svg"
alt="Arrow icon"
class="note-icon"
Copy link
Member

Choose a reason for hiding this comment

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

Might want to change the naming for this to be more semantic, since we do already have a note icon in the menu dropdown.

@Destaq Destaq merged commit 478b155 into notes-feature Nov 15, 2024
10 of 11 checks passed
@Destaq Destaq deleted the nidhi/notes-basic-frontend branch November 15, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants