Skip to content

Update picgo extension - #26818

Merged
raycastbot merged 2 commits into
raycast:mainfrom
RUBisco0211:ext/picgo
Apr 1, 2026
Merged

raycastbot merged 2 commits into
raycast:mainfrom
RUBisco0211:ext/picgo

Conversation

@RUBisco0211

@RUBisco0211 RUBisco0211 commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixed error when a plugin package data has no description field.

Screencast

Checklist

- update changelog
- fix: plugin search result error
- clean code
- Merge pull request raycast#6 from RUBisco0211/refactor/config-edit-form
- better form props type
- Merge pull request raycast#7 from RUBisco0211/coderabbitai/docstrings/061f947
- 📝 Add docstrings to `refactor/config-edit-form`
- refactor: config edit form
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: picgo Issues related to the picgo extension platform: macOS platform: Windows OP is author The OP of the PR is the author of the extension labels Apr 1, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for the update! 🎉

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@RUBisco0211
RUBisco0211 marked this pull request as ready for review April 1, 2026 09:25
@greptile-apps

greptile-apps Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a runtime crash in the plugin search view by guarding against undefined description fields in npm package data, and refactors ConfigEditForm to accept a single picgo context object with an explicit discriminated-union mode prop instead of individual callback props.

Key changes:

  • extensions/picgo/src/plugin-search.tsx / extensions/picgo/src/types/npm.d.ts: description is now typed as optional (description?: string) and accessed with ?.includes() to prevent the error when a package omits the field.
  • extensions/picgo/src/components/ConfigEditForm.tsx: Props refactored to a discriminated union mode: \"create\" | \"update\" combined with a single picgo context, replacing the previous pattern of passing individual getConfigItems, getUploaderTypeList, createOrUpdateConfig, and renameConfig callbacks. The now-redundant onSave callback is removed.
  • extensions/picgo/src/uploader-management.tsx & extensions/picgo/src/plugin-management.tsx: Updated call-sites to pass picgo context and explicit mode prop.
  • Minor cleanup: several imports converted to import type or import { type ... } for stricter type-only imports.

Confidence Score: 5/5

This PR is safe to merge — the fix is minimal and targeted, and the refactor is internally consistent.

The bug fix (optional chaining + optional type) is correct and complete. The ConfigEditForm refactor is clean: the discriminated union ensures TypeScript enforces that config is present in update mode, and all call-sites have been updated consistently. No logic was regressed and the removed onSave callback was never passed at any call-site. No P1 or P0 issues found.

No files require special attention.

Important Files Changed

Filename Overview
extensions/picgo/src/plugin-search.tsx Core bug fix: optional chaining (?.) guards against undefined description in the npm package filter
extensions/picgo/src/types/npm.d.ts Marks description as optional (description?: string) to match real npm API responses
extensions/picgo/src/components/ConfigEditForm.tsx Refactored to accept a discriminated-union mode prop and a single picgo context object instead of individual callback props; removes the now-unused onSave callback
extensions/picgo/src/uploader-management.tsx Updated all ConfigEditForm usages to pass picgo context and explicit mode prop; removes individual callback drilling
extensions/picgo/src/plugin-management.tsx Passes picgo context to ConfigEditForm and adds explicit mode="create" prop
extensions/picgo/CHANGELOG.md New bugfix entry added at the top with the correct {PR_MERGE_DATE} placeholder
extensions/picgo/src/types/type.d.ts Removes unused usePicGoContext import; converts IImgInfo to a type-only import
extensions/picgo/src/util/format.ts Converts value imports to type-only imports (import type) — cosmetic cleanup

Reviews (1): Last reviewed commit: "Update picgo extension" | Re-trigger Greptile

@0xdhrv 0xdhrv self-assigned this Apr 1, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

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 f8856ba into raycast:main Apr 1, 2026
2 checks passed
@github-actions

github-actions Bot commented Apr 1, 2026

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.

ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 2, 2026
- feat:up
- Merge branch \'raycast:main\' into main
- Update picgo extension (raycast#26818)
- Update CODEOWNERs (bd7023d)
- Add clockodo extension (raycast#26432)
@RUBisco0211
RUBisco0211 deleted the ext/picgo branch April 4, 2026 11:58
ariesly15 pushed a commit to ariesly15/raycast-extensions that referenced this pull request Apr 10, 2026
- feat[extensions/qq-mail]: 添加QQ邮箱扩展及配置文件
- Merge branch \'raycast:main\' into main
- Update CODEOWNERs (9944a1b)
- [XKCD Comics] Add viewing history (raycast#26704)
- refactor: 增加useCallback并更新tsconfig配置
- Update CODEOWNERs (9b7c8a4)
- Add Kafka UI extension (raycast#26259)
- Merge branch \'raycast:main\' into main
- refactor: 简化 Action.CopyToClipboard 组件调用 (url-parse.tsx)
- chore: 移除 delink 扩展中的图标配置项
- chore: 删除图标文件并更新配置引用新图标
- Update CODEOWNERs (756e9da)
- Update ascii-art-wallpaper extension (raycast#26707)
- Update CODEOWNERs (23ee8a8)
- Add paper-agent extension (raycast#26367)
- Merge branch \'raycast:main\' into main
- chore: 更新 delink 扩展变更日志并移除旧版本记录
- Update CODEOWNERs (768930b)
- Add nocal extension (raycast#26482)
- Update CODEOWNERs (7c0e492)
- Add caaals extension (raycast#26443)
- Merge branch \'raycast:main\' into main
- docs: 更新 delink 扩展文档及快捷键说明
- Update CODEOWNERs (41a12f0)
- Update mirror-displays extension (raycast#26445)
- chore: 更新 delink 扩展的版本信息为初始发布版
- docs: 调整 delink 扩展快捷键说明顺序
- Merge branch \'raycast:main\' into main
- feat:up
- Update CODEOWNERs (2134dff)
- Update hetzner extension (raycast#26705)
- Update CODEOWNERs (840e5a9)
- Add ram-prices extension (raycast#26564)
- Update CODEOWNERs (45fad15)
- Add habitica-todos extension (raycast#26446)
- Update CODEOWNERs (3e686e1)
- Add Bundles extension (raycast#25680)
- Update CODEOWNERs (f6261fd)
- Update tmux-cheatsheet extension (raycast#26379)
- Changelog Alignment (raycast#26824)
- Update prism-launcher extension (raycast#26816)
- Merge branch \'raycast:main\' into main
- feat: add metadata folder and language setting
- Update picgo extension (raycast#26818)
- Update CODEOWNERs (bd7023d)
- Add clockodo extension (raycast#26432)
- feat: add raycast extension delink
- Update CODEOWNERs (868aef4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: picgo Issues related to the picgo extension OP is author The OP of the PR is the author of the extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants