Skip to content

800: Fix Notion PR links mashing together instead of being \n separated - #796

Merged
tahminator merged 1 commit into
mainfrom
800
Feb 19, 2026
Merged

800: Fix Notion PR links mashing together instead of being \n separated#796
tahminator merged 1 commit into
mainfrom
800

Conversation

@tahminator

@tahminator tahminator commented Feb 19, 2026

Copy link
Copy Markdown
Member

800

Description of changes

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

image

github-actions[bot]
github-actions Bot previously approved these changes Feb 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions

Copy link
Copy Markdown
Contributor

Title

800: Fix Notion PR links mashing together instead of being \n separated


PR Type

Bug fix


Description

  • Insert newline between multiple PR links

  • Make PR links actual hyperlinks

  • Preserve existing duplicate-check behavior

  • Improve Notion rich_text link formatting


Diagram Walkthrough

flowchart LR
  start["Receive PR ID and Notion task"]
  exists["PR link already exists?"]
  hasRT["Existing rich_text present?"]
  addNL["Append newline rich_text"]
  addLink["Append PR link with hyperlink"]
  skip["Skip update"]
  done["Update complete"]

  start -- "process" --> exists
  exists -- "Yes" --> skip
  exists -- "No" --> hasRT
  hasRT -- "Yes" --> addNL
  hasRT -- "No" --> addLink
  addNL -- "then" --> addLink
  addLink -- "push to Notion" --> done
Loading

File Walkthrough

Relevant files
Bug fix
index.ts
Add newline and hyperlink for Notion PR links                       

.github/scripts/notion/task/index.ts

  • Add newline ("\n") rich_text when content exists
  • Convert PR text to hyperlink via text.link.url
  • Keep duplicate-link skip check intact
  • Prevent mashed-together PR links in Notion
+24/-1   

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Formatting Robustness

When adding the newline separator, the code unconditionally inserts "\n" if any prior content exists. If the last rich_text item already ends with a newline, this will accumulate blank lines over time. Consider checking the last character before appending the separator to avoid duplicate newlines.

// if there already is a url in there, add \n
if (prField.rich_text.length) {
  prField.rich_text.push({
    type: "text",
    text: {
      content: "\n",
      link: null,
    },
    plain_text: "\n",
    href: null,
    annotations: {
      bold: false,
      italic: false,
      strikethrough: false,
      underline: false,
      code: false,
      color: "default",
    },
  });
}
API Payload Consistency

A link is added via text.link, but href remains explicitly set to null. In Notion’s API, href is read-only and derived; including it (especially as null) can be confusing or potentially rejected depending on how the payload is built. Consider omitting href entirely or ensuring the request object only includes supported fields.

  link: {
    url: prLink,
  },
},
plain_text: prLink,
href: null,
annotations: {

Comment thread .github/scripts/notion/task/index.ts
Comment thread .github/scripts/notion/task/index.ts
github-actions[bot]
github-actions Bot previously approved these changes Feb 19, 2026
@tahminator

Copy link
Copy Markdown
Member Author

/deploy

@tahminator
tahminator merged commit 6afa2be into main Feb 19, 2026
31 checks passed
@tahminator
tahminator deleted the 800 branch February 19, 2026 18:50
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.

1 participant