Skip to content

Update kagi-news extension - #22539

Merged
raycastbot merged 4 commits into
raycast:mainfrom
mickaphd:ext/kagi-news
Oct 31, 2025
Merged

raycastbot merged 4 commits into
raycast:mainfrom
mickaphd:ext/kagi-news

Conversation

@mickaphd

@mickaphd mickaphd commented Oct 30, 2025 •

Copy link
Copy Markdown
Contributor

Description

Screencast

Checklist

- Merge contributions
- Pull contributions
- style: Fix code formatting with Prettier
- v1.1: Add display section preferences and improve article detail view
- Update Raycast before merging
- Apply reviewer feedback and updates
- v1.1.0
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: kagi-news Issues related to the kagi-news extension platform: macOS platform: Windows OP is author The OP of the PR is the author of the extension labels Oct 30, 2025
@raycastbot

raycastbot commented Oct 30, 2025 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @mickaphd 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.

@mickaphd

Copy link
Copy Markdown
Contributor Author

Hi @pernielsentikaer 👋

I added new sections (see below) to the article view with toggle settings. I ensured that the sources listed in the right panel correspond to the sources cited in the sections the user chooses to display. The rest of the code structure you updated last time remains unchanged, so it should be straightforward.

Screenshot 2025-10-30 at 22 07 14

Here is the changelog for this v1.1:

  • Optional display sections: toggle visibility of Images (primary and secondary), Talking Points, Perspectives, Historical Background, Technical Details, Industry Impact, Timeline, and International Reactions (Summary is always displayed)
  • Primary image displays between the article title and summary
  • Smart source extraction: metadata panel now shows sources from visible sections (more sections displayed = more sources)

Thanks 🙏
M

@mickaphd
mickaphd marked this pull request as ready for review October 30, 2025 21:17

@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

Greptile Summary

This PR enhances the kagi-news extension with comprehensive user customization features for article display. The main changes introduce 10 preference settings that allow users to selectively show/hide different article content sections including primary/secondary images, talking points, perspectives, historical background, technical details, industry impact, timeline, and international reactions. The implementation updates TypeScript interfaces to support richer API data, expands the article detail view component with conditional rendering based on user preferences, and includes smart source extraction that only processes visible content. The changelog properly documents these changes as version 1.1.0, and the README is updated with clearer feature descriptions. These enhancements transform the extension from a basic news reader into a customizable news consumption experience where users can control information density based on their interests.

PR Description Notes:

  • The PR description is empty aside from the checklist, which doesn't explain what changes were made or their purpose

Important Files Changed

Filename Score Overview
extensions/kagi-news/src/interfaces.ts 5/5 Expands TypeScript interfaces with new optional fields for richer article content display
extensions/kagi-news/src/views/ArticleDetail.tsx 4/5 Implements preference-driven conditional rendering for article sections with smart source extraction
extensions/kagi-news/package.json 4/5 Adds 10 new checkbox preferences for controlling article display sections
extensions/kagi-news/src/utils.ts 5/5 Updates article object creation to include new properties from expanded interface
extensions/kagi-news/CHANGELOG.md 3/5 Documents version 1.1.0 features but uses incorrect template format
extensions/kagi-news/README.md 5/5 Improves documentation with more specific feature descriptions and usage instructions
extensions/kagi-news/tsconfig.json 5/5 Minor formatting change removing trailing newline
extensions/kagi-news/eslint.config.js 5/5 Minor formatting change removing trailing newline
extensions/kagi-news/.gitignore 5/5 Minor formatting change removing trailing newline

Confidence score: 4/5

  • This PR is generally safe to merge with well-structured enhancements and proper TypeScript typing
  • Score reflects the comprehensive changes that improve user experience while maintaining code quality, with minor issues in changelog formatting and some empty preference titles
  • Pay close attention to the CHANGELOG.md file which uses incorrect template format and the package.json preferences that have empty title fields

9 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

module.exports = defineConfig([
...raycastConfig,
]);
]); No newline at end of file

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.

style: Missing trailing newline - most code formatters and POSIX standards expect files to end with a newline

Comment on lines +160 to +233
"title": "",
"label": "Show Talking Points",
"description": "Display key talking points from the article",
"default": true
},
{
"name": "showSecondaryImage",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Secondary Image",
"description": "Display the secondary article image",
"default": false
},
{
"name": "showPerspectives",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Perspectives",
"description": "Display different perspectives on the story",
"default": false
},
{
"name": "showHistoricalBackground",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Historical Background",
"description": "Display historical context",
"default": false
},
{
"name": "showTechnicalDetails",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Technical Details",
"description": "Display technical information",
"default": false
},
{
"name": "showIndustryImpact",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Industry Impact",
"description": "Display industry-related impacts",
"default": false
},
{
"name": "showTimeline",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Timeline",
"description": "Display timeline of events",
"default": false
},
{
"name": "showInternationalReactions",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show International Reactions",
"description": "Display reactions from international entities",
"default": false
},
{
"name": "showDidYouKnow",
"type": "checkbox",
"required": false,
"title": "",
"label": "Show Did You Know",

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.

style: Consider using title case for preference titles to group related settings. For example, use 'Content Display' or 'Article Sections' instead of empty strings for better organization in the preferences UI.

Context Used: Context from dashboard - Use the title case for titles in the preferences section of package.json files, e.g., 'Tab Width' in... (source)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did that on purpose to have only one section with all the checkboxes below it. Adding a title for each checkbox doesn't look good.

Comment thread extensions/kagi-news/CHANGELOG.md Resolved
let markdown = `# ${article.title}`;
let allVisibleText = ""; // Track all visible content for source extraction

const articleMetadata = article as Record<string, unknown>;

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.

style: Type assertion bypasses TypeScript safety. Consider extending the Article interface to include these optional properties instead of casting to Record<string, unknown>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The aim was to ensure that users do not miss sources listed in the additional sections they choose to display.

const articleMetadata = article as Record<string, unknown>;

if (preferences.showPrimaryImage && articleMetadata.primary_image) {
const primaryImage = articleMetadata.primary_image as { url?: string; caption?: string };

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.

style: Type assertion without proper validation could cause runtime errors if primary_image structure differs from expectation


# misc
.DS_Store
.DS_Store No newline at end of file

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.

style: Missing trailing newline. Most text editors and Unix tools expect files to end with a newline character.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@mickaphd

Copy link
Copy Markdown
Contributor Author

@greptileai could you please check again?

@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.

Looking at the diff more carefully, I notice several improvements have been made to the kagi-news extension:

Main Changes:

  1. New Display Preferences: Added 9 new checkbox preferences in package.json to control visibility of different article sections (primary image, talking points, secondary image, perspectives, historical background, technical details, industry impact, timeline, international reactions, and did you know).

  2. Enhanced Article Structure: Updated interfaces.ts to include new optional fields like primary_image, secondary_image, perspectives, historical_background, technical_details, industry_impact, timeline, and international_reactions.

  3. Smart Article Detail View: Completely rewrote ArticleDetail.tsx to:

    • Respect user preferences for which sections to display
    • Show primary image between title and summary
    • Display secondary images with captions
    • Include new sections like perspectives, timeline, etc.
    • Smart source extraction: Only extract sources from visible content sections
  4. Updated Documentation: Modified README.md and CHANGELOG.md to reflect the new features.

Code Quality Issues:

The main issue I see is in the ArticleDetail.tsx file - there's some type casting that could be improved:

const articleMetadata = article as Record<string, unknown>;
// Later used as:
const primaryImage = articleMetadata.primary_image as { url?: string; caption?: string };

This type casting approach works but isn't type-safe. Since you've already defined these properties in the Article interface, you could access them directly:

// Instead of casting, use the properly typed interface
if (preferences.showPrimaryImage && article.primary_image) {
  const primaryImage = article.primary_image;
  if (primaryImage.url) {
    markdown += `\n\n![Primary Image](${primaryImage.url})`;
    if (primaryImage.caption) {
      markdown += `\n\n> *${primaryImage.caption}*`;
    }
  }
}

The changes look good overall - they add significant functionality while maintaining backwards compatibility through the optional nature of all new fields and preferences defaulting to sensible values.

…s instead of using metadata. Restore repository information in package.json.
@raycastbot raycastbot added the OP is contributor The OP of the PR is a contributor of the extension label Oct 31, 2025
@pernielsentikaer

Copy link
Copy Markdown
Contributor

Hi @mickaphd 👋

I updated the code to resolve the error, could you make sure I didn't break it?

@pernielsentikaer

Copy link
Copy Markdown
Contributor

@greptileai can you do a new review?

@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.

Looking at this PR, I can see significant improvements to the Kagi News extension with new display section preferences and enhanced article detail views. Here's my review:

🎉 Great Improvements

Enhanced User Control: The addition of granular display section preferences is excellent - users can now customize which parts of articles they want to see (images, talking points, perspectives, etc.).

Smart Source Extraction: The logic to extract sources only from visible content is well-implemented and provides a better user experience.

Rich Content Support: Adding support for primary/secondary images, perspectives, timelines, and other structured data makes articles much more informative.

🔧 Code Quality Issues

File 4: extensions/kagi-news/eslint.config.js

const { defineConfig } = require("@eslint/config-array");
const raycastConfig = require("@raycast/eslint-config");

module.exports = defineConfig([
  ...raycastConfig,
]);

File 1: extensions/kagi-news/.gitignore

compiled_raycast_swift
compiled_raycast_rust

# misc
.DS_Store

File 13: extensions/kagi-news/tsconfig.json

{
  "extends": "@raycast/eslint-config/tsconfig.json",
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": false,
    "jsx": "react-jsx",
    "resolveJsonModule": true
  }
}

📦 Package.json Structure

The repository field placement change (moving it to the end) is fine, but consider keeping it in a consistent location for better maintainability.

🎨 UI/UX Considerations

Preferences Organization: The display section preferences are well-structured, but consider grouping related options (e.g., "Images", "Content Sections", "Additional Information") for better UX.

Default Values: Good choice making primary image, talking points, and "Did You Know" sections default to true while keeping advanced sections like technical details and industry impact as false by default.

🧪 Testing Recommendations

  1. Empty Content Handling: Ensure the app gracefully handles cases where optional sections are enabled but the API doesn't return data for them.

  2. Image Loading: Test behavior when image URLs are invalid or fail to load.

  3. Performance: With more content sections, verify that articles with many enabled sections still render smoothly.

📖 Documentation

The README updates are good but could be more specific about the new customization features. Consider adding a section about the display preferences.

Overall Assessment

This is a solid enhancement that significantly improves the extension's functionality and user experience. The code is well-structured and the new features are implemented thoughtfully. Just address the minor formatting issues and this will be ready to merge! ✅

@mickaphd mickaphd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot, @pernielsentikaer. Everything looks good to me; nothing seems broken.
You can merge it! Have a nice weekend.
Cheers,
M

@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 59c7a47 into raycast:main Oct 31, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/mickaphd/kagi-news

@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 Nov 13, 2025
Charles Symons