Link Joy vs Drain post from user-facing references - #15
Conversation
- Add the Joy vs Drain blog post to card.json posts (third position) - Make 'Joy or drain?' heading on optional screen a clickable link - Link Joy and Drain words in results joyLine to the post - Replace 'Joy vs Drain' phrase in readings with a real link - Include the URL in markdown export when readings mention it The readings that say 'Read Joy vs Drain, linked below' now render an actual link instead of escaping everything to plain text. Co-authored-by: Tig <tig@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 978004fbcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| paras.forEach(function (p) { lines.push("- " + p.text); }); | ||
| var hasJoyDrain = false; | ||
| paras.forEach(function (p) { | ||
| if (p.text.indexOf("Joy vs Drain") >= 0) hasJoyDrain = true; |
There was a problem hiding this comment.
Include the Joy vs Drain URL for every joy export
When a user completes the optional section but neither their superpower nor growth edge is marked as draining—for example, j=CBTO—the reading contains only joy_clear/joy_clear_no_edge, so hasJoyDrain remains false. The copied Markdown still contains the user-facing Joy: ... Drain: ... summary but omits the new source URL, leaving this export path unlinked; base the condition on st.j != null as well as paragraph contents.
Useful? React with 👍 / 👎.
Link the 2025 Joy vs Drain blog post from all user-facing joy/drain references in the CBTO app.
Changes
card.json
js/cbto.js
JOY_DRAIN_URLconstant for the blog post URLjoyDrainLink()andlinkJoyDrainPhrase()helpers to wrap "Joy vs Drain" in a link after escaping (safe rendering)joyLineHtml()that renders Joy and Drain as links in the results joyLinetarget="_blank" rel="noopener noreferrer")How it works
The readings in
data/interpretations.jsonsay "Read Joy vs Drain, linked below" butshowResultspreviously HTML-escaped every paragraph, so no link was ever rendered. This change:The Joy/Drain buttons on the optional screen remain buttons (not links).
Testing
node scripts/check_reading.jspasses: 55,296 readings, 13,840 permalink round trips, 14 templates all reachable.