Skip to content

Path banners: unsubmitted-hours nudge + top-right notification pane#242

Merged
iUnstable0 merged 1 commit into
mainfrom
feature/explore
Jun 5, 2026
Merged

Path banners: unsubmitted-hours nudge + top-right notification pane#242
iUnstable0 merged 1 commit into
mainfrom
feature/explore

Conversation

@iUnstable0
Copy link
Copy Markdown
Collaborator

What

Path-page banner improvements, shipped together:

  • Unsubmitted-hours nudge — full users past the 20h floor with no ships get an info banner prompting them to submit a project. Driven by a new path_controller unsubmitted_hours share (memoized hours query) + useUnsubmittedHoursAnnouncement hook.
  • YouTube 24h+ duration fixYouTubeService#parse_iso8601_duration now handles the P#DT#H#M#S form (e.g. a 30h video is P1DT6H1S), which the old PT-only regex couldn't parse.
  • Top-right notification pane — the path announcements move from a wide centered bar to a compact pane under the currency counters, nested in the Header counter column. Keeps the playful pinned-paper look (twine/tacks/tilt); dismissal behavior unchanged (feedback-only, permanent).

Verification

  • rubocop clean on changed Ruby; prettier --check clean on all changed frontend files; tsc reports no new errors in touched files.
  • No merge conflicts with main: the only file main also changed is types/index.ts, in disjoint regions (line ~45 vs 391+); all other files are untouched on main.

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings June 5, 2026 14:58
@iUnstable0 iUnstable0 merged commit 2c97dae into main Jun 5, 2026
10 of 12 checks passed
@iUnstable0 iUnstable0 deleted the feature/explore branch June 5, 2026 14:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_hours Inertia share on PathController and a corresponding useUnsubmittedHoursAnnouncement hook to show an info banner for full users above the 20h floor with no ships.
  • Move AnnouncementsBar rendering into the path Header’s counter column, and update announcement card/link behavior to support modal links.
  • Expand YouTubeService#parse_iso8601_duration to 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
@iUnstable0 iUnstable0 restored the feature/explore branch June 5, 2026 16:55
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.

2 participants