Path banners: unsubmitted-hours nudge + top-right notification pane#242
Merged
Conversation
- Add a "logged but not submitted" nudge banner (info) for full users past the 20h floor with no ships, via a path_controller inertia_share and the useUnsubmittedHoursAnnouncement hook - Fix YouTubeService ISO8601 duration parsing for videos >= 24h (P#DT#H#M#S, e.g. a 30h video is "P1DT6H1S") - Redesign the path announcements as a compact top-right notification pane below the currency counters, nesting AnnouncementsBar in the Header counter column (shrunk pinned-paper cards, kept twine/tacks/tilt) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the path page’s announcement UX (moving announcements into a compact top-right pane and adding an “unsubmitted hours” nudge), and fixes YouTube ISO8601 duration parsing for 24h+ videos.
Changes:
- Add a new
unsubmitted_hoursInertia share onPathControllerand a correspondinguseUnsubmittedHoursAnnouncementhook to show an info banner for full users above the 20h floor with no ships. - Move
AnnouncementsBarrendering into the pathHeader’s counter column, and update announcement card/link behavior to support modal links. - Expand
YouTubeService#parse_iso8601_durationto handle day components (P#DT#H#M#S) for long videos.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/services/you_tube_service.rb | Updates ISO8601 duration parsing to support day components for 24h+ YouTube videos. |
| app/controllers/path_controller.rb | Adds unsubmitted_hours share and memoizes logged seconds for reuse within the request. |
| app/frontend/types/index.ts | Extends SharedProps with unsubmitted_hours typing for the new share. |
| app/frontend/components/announcements/useUnsubmittedHoursAnnouncement.ts | Adds the new “unsubmitted hours” announcement source. |
| app/frontend/components/announcements/types.ts | Adds modal option to Announcement to support modal navigation. |
| app/frontend/components/announcements/AnnouncementsBar.tsx | Incorporates the new announcement and adjusts layout for the top-right pane. |
| app/frontend/components/announcements/AnnouncementCard.tsx | Adds ModalLink support and updates card layout to fit the compact pane. |
| app/frontend/components/path/Header.tsx | Renders the announcements pane under the currency/streak counters. |
| app/frontend/pages/path/index.tsx | Removes the old AnnouncementsBar placement since it’s now inside Header. |
Comment on lines
+169
to
+174
| # YouTube uses a days component for videos >= 24h (e.g. a 30h video is "P1DT6H1S"), | ||
| # which the old PT-only regex couldn't match. | ||
| match = duration_string.match(/\AP(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?\z/) | ||
| return nil unless match | ||
| (match[1].to_i * 3600) + (match[2].to_i * 60) + match[3].to_i | ||
| days, hours, minutes, seconds = match.captures.map(&:to_i) | ||
| (days * 86_400) + (hours * 3_600) + (minutes * 60) + seconds |
Comment on lines
43
to
46
| has_unread_mail: boolean | ||
| current_streak: number | ||
| unsubmitted_hours: number | null | ||
| streak_freezes: number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Path-page banner improvements, shipped together:
infobanner prompting them to submit a project. Driven by a newpath_controllerunsubmitted_hoursshare (memoized hours query) +useUnsubmittedHoursAnnouncementhook.YouTubeService#parse_iso8601_durationnow handles theP#DT#H#M#Sform (e.g. a 30h video isP1DT6H1S), which the oldPT-only regex couldn't parse.Headercounter column. Keeps the playful pinned-paper look (twine/tacks/tilt); dismissal behavior unchanged (feedback-only, permanent).Verification
rubocopclean on changed Ruby;prettier --checkclean on all changed frontend files;tscreports no new errors in touched files.main: the only filemainalso changed istypes/index.ts, in disjoint regions (line ~45 vs 391+); all other files are untouched onmain.🤖 Generated with Claude Code