Skip to content

feat: implement Token Horoscope daily satirical AI horoscope (Phase 3 PRD #1)#103

Merged
nitrocode merged 3 commits into
mainfrom
copilot/implement-unimplemented-prd
Apr 27, 2026
Merged

feat: implement Token Horoscope daily satirical AI horoscope (Phase 3 PRD #1)#103
nitrocode merged 3 commits into
mainfrom
copilot/implement-unimplemented-prd

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

  • Verify finding: line 146 of docs/LEARNINGS.md has PR #95, needs to be PR #103
  • Update the header line only; leave all other content unchanged

Summary by CodeRabbit

  • New Features
    • Added a new "Daily Prophecy" card displaying personalized daily horoscope content. The card is collapsible (expanded by default), remembers your viewing state, and includes a share button to export the daily prophecy.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

Adds a deterministic "Token Horoscope" feature: a 30-template pool and a pure function to select a daily template by UTC day, exposes them via DeathClockCore, wires a client UI (render, localStorage viewed-tracking, share), updates build order, styles, tests, and docs.

Changes

Cohort / File(s) Summary
Core Horoscope Logic
death-clock-core.js, src/js/00-state.js
Adds HOROSCOPE_TEMPLATES (≈30 templates) and getDailyHoroscope(nowMs, templates); exports both on DeathClockCore and imports them into local state module.
Horoscope UI Module
src/js/21-horoscope.js
New initialization: compute UTC date, call getDailyHoroscope(HOROSCOPE_TEMPLATES), render #horoscope-text/#horoscope-date, localStorage key tokenDeathclockHoroscopeDate to track "viewed today", toggle listener to persist state, and share button handler using openSharePopup().
UI Structure & Styling
index.html, styles/features.css
Inserts a collapsible "Daily Prophecy" card into the dashboard and adds CSS for card, open-state accent, summary row, typography, and action layout.
Build & Integration
scripts/build-js.js, src/js/22-boot.js
Build order updated to include 21-horoscope.js before boot; boot sequence now calls initHoroscope() during startup.
Testing & Documentation & Stats
tests/death-clock.test.js, docs/LEARNINGS.md, project-stats.yaml
Adds unit tests for templates and selection behavior, documents the feature and build-file renumbering, and increments pr_count and total_tokens in project stats.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Browser
    participant Core as DeathClockCore
    participant Storage as localStorage
    participant UI as DOM
    participant Share as Share Popup

    User->>Browser: Load page
    Browser->>Core: Read HOROSCOPE_TEMPLATES & getDailyHoroscope
    Browser->>Core: Call getDailyHoroscope(nowMs, templates)
    Core-->>Browser: Return horoscope text
    Browser->>Storage: Read tokenDeathclockHoroscopeDate
    alt not viewed today
        Browser->>UI: Render horoscope, set <details open>
        Browser->>Storage: Write today's date
    else already viewed
        Browser->>UI: Render horoscope, ensure <details> closed
    end
    UI->>UI: Listen for toggle -> persist when opened
    User->>UI: Click share
    UI->>Share: openSharePopup(shareText)
    Share-->>User: Show share dialog
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nitrocode
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is extremely minimal and does not follow the required template structure, missing Summary, Changes checklist, and Agent Checklist sections entirely. Rewrite the description following the template: add a Summary section explaining the problem and solution, create a comprehensive Changes checklist covering all file modifications, and complete the Agent Checklist verifying all requirements.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: implement Token Horoscope daily satirical AI horoscope (Phase 3 PRD #1)' directly describes the main feature implementation across all modified files, including core logic, UI, styling, and tests.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/implement-unimplemented-prd

Comment @coderabbitai help to get the list of available commands and usage tips.

@nitrocode nitrocode marked this pull request as ready for review April 27, 2026 02:05
@nitrocode nitrocode self-requested a review as a code owner April 27, 2026 02:05
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

👁️ PR Preview

🚀 Open Preview

Deployed from commit 855d6a8 · Updates on every push to this PR
(Preview is removed automatically when the PR is closed.)

Screenshots

Desktop Mobile
Desktop Mobile

github-actions Bot added a commit that referenced this pull request Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a76dc50) to head (855d6a8).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #103   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          242       247    +5     
  Branches       109       110    +1     
=========================================
+ Hits           242       247    +5     
Flag Coverage Δ
unit 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
death-clock-core.js 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a76dc50...855d6a8. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/LEARNINGS.md`:
- Around line 146-151: Update the PR identifier in the LEARNINGS entry so it
correctly references this change: replace "PR `#95`" with "PR `#103`" (or explicitly
note it's a backfill referencing `#103`) in the header line of the horoscope entry
in docs/LEARNINGS.md, ensuring the rest of the entry (HOROSCOPE_TEMPLATES,
getDailyHoroscope, src/js/21-horoscope.js, PARTS renumbering note, and key files
list) remains unchanged for traceability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ab02bdb-e7e5-47ca-a06b-a7bbbacba182

📥 Commits

Reviewing files that changed from the base of the PR and between 44cfda6 and 31d2df5.

📒 Files selected for processing (10)
  • death-clock-core.js
  • docs/LEARNINGS.md
  • index.html
  • project-stats.yaml
  • scripts/build-js.js
  • src/js/00-state.js
  • src/js/21-horoscope.js
  • src/js/22-boot.js
  • styles/features.css
  • tests/death-clock.test.js

Comment thread docs/LEARNINGS.md Outdated
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/LEARNINGS.md (1)

148-151: Consider adding this renumbering wisdom to the Categorised Learnings table, fool!

I appreciate how you documented the renumbering pattern in the PR entry, but I pity the fool who makes the same mistake in the future without checking this specific PR log entry. The learning about renumbering source files when inserting between existing ones is gold, and it's related to but distinct from A1.

You could add a new row A5 to the "Architecture & Code Organisation" table (around line 105) to make this wisdom more discoverable:

| A5 | When inserting a new numbered source file between existing ones (e.g., adding `21-horoscope.js` between `20-tabs.js` and `21-boot.js`), renumber all subsequent files and update the `PARTS` array in `scripts/build-js.js` to maintain strict sequential order. Out-of-order names confuse future agents. | `#103` |

This ain't mandatory since the guideline says "if it reveals a new recurring pattern" and this is the first occurrence, but I predict this pattern WILL recur, fool, so documenting it now would be helping your future self!

As per coding guidelines docs/LEARNINGS.md: "add a row to the relevant categorised learnings table if it reveals a new recurring pattern"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/LEARNINGS.md` around lines 148 - 151, Add a new row A5 to the
"Architecture & Code Organisation" categorised learnings table documenting the
renumbering rule when inserting numbered source files: state that when adding a
file like 21-horoscope.js between existing numbered modules you must renumber
all subsequent files and update the PARTS array in scripts/build-js.js to
preserve strict sequential order (include the short example and reference `#103`);
place this new A5 entry near the other architecture rows so the renumbering
wisdom is discoverable alongside A1.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/LEARNINGS.md`:
- Around line 148-151: Add a new row A5 to the "Architecture & Code
Organisation" categorised learnings table documenting the renumbering rule when
inserting numbered source files: state that when adding a file like
21-horoscope.js between existing numbered modules you must renumber all
subsequent files and update the PARTS array in scripts/build-js.js to preserve
strict sequential order (include the short example and reference `#103`); place
this new A5 entry near the other architecture rows so the renumbering wisdom is
discoverable alongside A1.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62daf340-38dd-48f1-b48c-1773efcd572a

📥 Commits

Reviewing files that changed from the base of the PR and between 31d2df5 and 855d6a8.

📒 Files selected for processing (1)
  • docs/LEARNINGS.md

@nitrocode nitrocode merged commit a2401ee into main Apr 27, 2026
10 checks passed
@nitrocode nitrocode deleted the copilot/implement-unimplemented-prd branch April 27, 2026 02:36
github-actions Bot added a commit that referenced this pull request Apr 27, 2026
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