Skip to content

Link Joy vs Drain post from user-facing references - #15

Merged
tig merged 1 commit into
mainfrom
cursor/joy-drain-links-4f5c
Aug 23, 2026
Merged

Link Joy vs Drain post from user-facing references#15
tig merged 1 commit into
mainfrom
cursor/joy-drain-links-4f5c

Conversation

@tig

@tig tig commented Aug 23, 2026

Copy link
Copy Markdown
Member

Link the 2025 Joy vs Drain blog post from all user-facing joy/drain references in the CBTO app.

Changes

card.json

  • Add the Joy vs Drain post as the third item in posts (after CBTO primer and leadership priorities)

js/cbto.js

  • Add JOY_DRAIN_URL constant for the blog post URL
  • Add joyDrainLink() and linkJoyDrainPhrase() helpers to wrap "Joy vs Drain" in a link after escaping (safe rendering)
  • Add joyLineHtml() that renders Joy and Drain as links in the results joyLine
  • Make the "Joy or drain?" heading on the optional screen a clickable link (target="_blank" rel="noopener noreferrer")
  • Replace the escaped "Joy vs Drain" phrase in readings with an actual link (joy_clash, joy_superpower_drain interpretations now render clickable)
  • Include the URL in markdown export when any reading mentions "Joy vs Drain"

How it works

The readings in data/interpretations.json say "Read Joy vs Drain, linked below" but showResults previously HTML-escaped every paragraph, so no link was ever rendered. This change:

  1. Escapes the text first (for safety)
  2. Then replaces the known phrase "Joy vs Drain" with a safe link

The Joy/Drain buttons on the optional screen remain buttons (not links).

Testing

node scripts/check_reading.js passes: 55,296 readings, 13,840 permalink round trips, 14 templates all reachable.

Open in Web Open in Cursor 

- 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>
@tig
tig merged commit 5306231 into main Aug 23, 2026
2 checks passed
@tig
tig deleted the cursor/joy-drain-links-4f5c branch August 23, 2026 22:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread js/cbto.js
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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