Improve sidebar empty states #100

Open
naemii wants to merge 2 commits from ni/emptystate into main
Member

Added 3 features:
No schedule: the sidebar explains that a schedule is needed first and points to "Create Schedule"
No courses: message plus an "Add a course" button that switches the section into edit mode
No clubs: message plus an "Add a club" button (edit mode) and a "Browse events" Link to /explore

All features work in light/dark mode

Added 3 features: No schedule: the sidebar explains that a schedule is needed first and points to "Create Schedule" No courses: message plus an "Add a course" button that switches the section into edit mode No clubs: message plus an "Add a club" button (edit mode) and a "Browse events" Link to /explore All features work in light/dark mode
Improve sidebar empty states
Some checks failed
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
kennel/build build succeeded
CI / check-1 (pull_request) Failing after 3m16s
CI / build (pull_request) Successful in 8m26s
CI / check (pull_request) Failing after 0s
99aea8388c
fix(web): rework the sidebar empty states from review
All checks were successful
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
nixbot/nix-build 0 attributes built
CI / check-1 (pull_request) Successful in 2m38s
kennel/build build succeeded
CI / build (pull_request) Successful in 8m47s
CI / check (pull_request) Successful in 0s
24a617b440
- No schedule: only a card whose button opens the navbar's create-schedule
  form, since courses and clubs need a schedule first.
- No courses or clubs: a quiet placeholder with an Add text button; edit mode
  focuses the search box.
- Keep the section headers as buttons with aria-expanded, drop the inner
  scroll boxes, and use plain ASCII quotes.
jalenluorion left a comment

here is an example review that claude generated cause im too lazy lol. usually this is what a code review would look like tho, just to give you a feel with what to expect. in this case i just had claude do these fixes themself.


Nice first PR, @naemii. This covers everything in #25, and dark mode looks right. I ran it locally and tried all three states (no schedule, no courses, no clubs). A few things to fix before it merges, and some design suggestions.

Must fix

  1. Section headers lost keyboard access. "My Courses" and "My Clubs" changed from <h3><button aria-expanded> to a clickable <div>. Keyboard and screen-reader users can no longer open or close those sections. Keep the button version from main.
  2. Curly quotes fail CI. The "Create Schedule" text uses typographic quotes, which the repo's block-ai-slop hook rejects. Use plain ".
  3. Unrelated scroll boxes. max-h-80 overflow-y-auto on the lists puts a second scroll area inside the scrolling sidebar. With a few courses, "My Courses" gets cut off after two items. It's outside this issue, so please drop it.

Design suggestions

  • No schedule. Every new user lands here (the API doesn't create a schedule for them), so it matters most.
    • Right now it's text that sends them to look for a button elsewhere, and that button only exists on desktop.
    • The Courses and Clubs headers still show their eye and pencil buttons, but nothing works without a schedule.
    • Try: show only a card with a "Create schedule" button that opens the navbar's existing create form. For example, the sidebar dispatches window.dispatchEvent(new Event("cmucal:create-schedule")) and Navbar listens for it and calls setShowNewScheduleInput(true). Hide the two sections until there's a schedule.
  • No courses / no clubs.
    • Two filled blue buttons compete for attention in a narrow sidebar.
    • They do the same thing as the pencil icon right above them, and the sentence repeats the button text.
    • Try: a quiet dashed placeholder that says "No courses yet", with a small "+ Add a course" text button.
    • Add autoFocus to the search box, so clicking it lets you type straight away.
  • Clubs link. "Browse events" is a good idea, but reads as unrelated next to clubs. Something like "or find clubs through their events on Explore" explains why it's there.

Happy to pair on any of this. Push the changes to this branch and the PR will update.

here is an example review that claude generated cause im too lazy lol. usually this is what a code review would look like tho, just to give you a feel with what to expect. in this case i just had claude do these fixes themself. --- Nice first PR, @naemii. This covers everything in #25, and dark mode looks right. I ran it locally and tried all three states (no schedule, no courses, no clubs). A few things to fix before it merges, and some design suggestions. **Must fix** 1. **Section headers lost keyboard access.** "My Courses" and "My Clubs" changed from `<h3><button aria-expanded>` to a clickable `<div>`. Keyboard and screen-reader users can no longer open or close those sections. Keep the button version from main. 2. **Curly quotes fail CI.** The `"Create Schedule"` text uses typographic quotes, which the repo's `block-ai-slop` hook rejects. Use plain `"`. 3. **Unrelated scroll boxes.** `max-h-80 overflow-y-auto` on the lists puts a second scroll area inside the scrolling sidebar. With a few courses, "My Courses" gets cut off after two items. It's outside this issue, so please drop it. **Design suggestions** - **No schedule.** Every new user lands here (the API doesn't create a schedule for them), so it matters most. - Right now it's text that sends them to look for a button elsewhere, and that button only exists on desktop. - The Courses and Clubs headers still show their eye and pencil buttons, but nothing works without a schedule. - Try: show only a card with a "Create schedule" button that opens the navbar's existing create form. For example, the sidebar dispatches `window.dispatchEvent(new Event("cmucal:create-schedule"))` and `Navbar` listens for it and calls `setShowNewScheduleInput(true)`. Hide the two sections until there's a schedule. - **No courses / no clubs.** - Two filled blue buttons compete for attention in a narrow sidebar. - They do the same thing as the pencil icon right above them, and the sentence repeats the button text. - Try: a quiet dashed placeholder that says "No courses yet", with a small "+ Add a course" text button. - Add `autoFocus` to the search box, so clicking it lets you type straight away. - **Clubs link.** "Browse events" is a good idea, but reads as unrelated next to clubs. Something like "or find clubs through their events on Explore" explains why it's there. Happy to pair on any of this. Push the changes to this branch and the PR will update.
Some checks are pending
nixbot/nix-eval evaluation succeeded in 0s (1 warning)
Required
Details
nixbot/nix-build 0 attributes built
Required
Details
CI / check-1 (pull_request) Successful in 2m38s
kennel/build build succeeded
CI / build (pull_request) Successful in 8m47s
CI / check (pull_request) Successful in 0s
CI / checks*
Required
kennel/deploy
Required
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'ni/emptystate:ni/emptystate'
git switch 'ni/emptystate'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/cal!100
No description provided.