Repository navigation
[Linear] Use API-provided notification presentation - #22285
Conversation
- Merge branch \'contributions/merge-1760907270510\' - Pull contributions - chore: update @linear/sdk to 61.0.0 - feat: notification improvements - Initial commit
|
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. |
There was a problem hiding this comment.
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/sdkv61.0.0
Technical approach:
- GraphQL query enhanced to fetch
title,subtitle,urlfrom 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
|
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
|
@pernielsentikaer All set, restored since I saw Spotify extension also having it there. Please review again! |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
- 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
Description
Linear's API presents notification text via a
titleandsubtitlefield, 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 😅
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder