Skip to content

[Linear] Use API-provided notification presentation - #22285

Merged
raycastbot merged 8 commits into
raycast:mainfrom
itsmingjie:ext/linear
Oct 29, 2025
Merged

raycastbot merged 8 commits into
raycast:mainfrom
itsmingjie:ext/linear

Conversation

@itsmingjie

@itsmingjie itsmingjie commented Oct 19, 2025 •

Copy link
Copy Markdown
Contributor

Description

Linear's API presents notification text via a title and subtitle field, which can be used to present notification body directly (sort of a private API since it's undocumented, but it's stable & available since our first-party apps depend on them - will make the case to make these fields public internally).

This PR updates the presentation logic so that we present notifications directly from API, instead of having to maintain different notification types manually. Also, because we now pull these from API directly, it should now also respect user configuration of "Display full names" inside Linear.

Fixes #22096
Fixes #22322

This PR also adds a new "Mark all notification as read" action to applicable views.

Maintenance: Bumped Linear SDK to v61.0.0.

Screencast

Quite a bit of blur on these, but should get the point across 😅

Before After
CleanShot 2025-10-19 at 14 00 38@2x CleanShot 2025-10-19 at 14 01 43@2x

Checklist

- Merge branch \'contributions/merge-1760907270510\'
- Pull contributions
- chore: update @linear/sdk to 61.0.0
- feat: notification improvements
- Initial commit
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: linear Issues related to the linear extension AI Extension platform: macOS platform: Windows OP is contributor The OP of the PR is a contributor of the extension labels Oct 19, 2025
@raycastbot

raycastbot commented Oct 19, 2025 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @thomaslombart @thomaspaulmann @peduarte @clemb8 @jfkisafk @filipszczepanski @JoeBoulton @itsmingjie you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

@itsmingjie
itsmingjie marked this pull request as ready for review October 19, 2025 21:06
@itsmingjie itsmingjie changed the title Update linear extension [Linear] Use API-provided notification presentation Oct 19, 2025

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Excellent refactoring that modernizes notification handling by leveraging Linear's API-provided title, subtitle, and url fields.

Key improvements:

  • Removed 280+ lines of manual notification type mapping by using API-provided display strings
  • Now respects user's Linear settings (e.g., "Display full names")
  • Added "Mark All as Read" action to both notifications command and menu bar with proper optimistic updates
  • Updated to @linear/sdk v61.0.0

Technical approach:

  • GraphQL query enhanced to fetch title, subtitle, url from notification objects
  • getNotificationTitle() function completely removed in favor of direct API fields
  • Icon mapping simplified to pattern-based matching with fallbacks
  • URL resolution now prioritizes API-provided URL over legacy logic

The refactoring solves the reported issue #22096 where unknown notification types were rendering incorrectly. By relying on Linear's API to provide display text, the extension will automatically support new notification types without manual updates.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • Score reflects clean refactoring with smart simplification, proper fallback handling, and well-implemented optimistic updates. The removal of 280+ lines of manually maintained notification types in favor of API-driven display is a significant maintainability improvement. The CHANGELOG entry uses a specific date (2025-10-19) which aligns with repository conventions for already-merged PRs.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
extensions/linear/CHANGELOG.md 4/5 Added changelog entry for notification improvements with proper date format instead of placeholder
extensions/linear/src/api/getNotifications.ts 5/5 Added title, subtitle, and url fields to notification query to support API-driven display
extensions/linear/src/helpers/notifications.ts 5/5 Removed 280+ lines of manual notification type handling, replaced with pattern-based icon mapping using API data
extensions/linear/src/notifications.tsx 5/5 Replaced manual title generation with API-provided title/subtitle, added Mark All as Read action with optimistic updates

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@pernielsentikaer

Copy link
Copy Markdown
Contributor

That's a pretty awesome update :)

Is there a reason why you removed "Configure Command" from menu bar?

@itsmingjie

Copy link
Copy Markdown
Contributor Author

That's a pretty awesome update :)

Is there a reason why you removed "Configure Command" from menu bar?

Not in particular, mostly didn't see it was a convention and with the introduction of a new menu item, wanted to keep the list short. Could revert if this was pattern!

- Merge branch \'contributions/merge-1761151111106\'
- Pull contributions
- chore: add back configure command
@itsmingjie

Copy link
Copy Markdown
Contributor Author

@pernielsentikaer All set, restored since I saw Spotify extension also having it there. Please review again!

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit c0cbd5c into raycast:main Oct 29, 2025
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

csymons pushed a commit to csymons/raycast-extensions that referenced this pull request Oct 29, 2025
- update dependencies
- fix(scheduler): add missing code changes
- package-lock.json update
- fix: add missing BACKGROUND_REFRESH_STATUS to STORAGE_KEYS
- Pull contributions
- update changelog
- docs: update CHANGELOG for background refresh alert feature
- feat: add background refresh status alert to scheduled command form
- [Linear] Use API-provided notification presentation (raycast#22285)
- Update CODEOWNERs (1a7209e)
- Update harvest extension (raycast#22256)
- Update CODEOWNERs (13787cd)
- Fix finding button in Tahoe. (raycast#22330)
- Update GitHub Actions workflow for PR approvals (raycast#22487)
- Docs: update for the new API release
- Update CODEOWNERs (77f6477)
- Added support for Asana sections (raycast#21912)
- Update auto-label workflow for PR approvals (raycast#22484)
- Update GitHub Actions workflow to set effective token (raycast#22482)
- Update workflow to use pull_request_review event (raycast#22479)
- Update CODEOWNERs (d5727aa)
- Add action to generate and copy private links (raycast#22273)
- Enhance PR approval labeling workflow (raycast#22477)
- Chatgpt atlas bookmarks improvement (raycast#22371)
- Add windows support  (raycast#22367)
- Update diskutil-mac extension (raycast#22307)
- [Secret Browser Commands] add ChatGPT Atlas, etc (raycast#22348)
- Update deployhq extension (raycast#22319)
- [Serie A] Update