Skip to content

Update ascii-art-wallpaper extension - #26707

Merged
raycastbot merged 3 commits into
raycast:mainfrom
alexi-build:ext/ascii-art-wallpaper
Apr 2, 2026
Merged

raycastbot merged 3 commits into
raycast:mainfrom
alexi-build:ext/ascii-art-wallpaper

Conversation

@alexi-build

@alexi-build alexi-build commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Improve settings persistence so color mode, background, text color, and density stay in sync across Search Artworks, Auto ASCII Wallpaper, and the background rotation command.

If someone prefers different settings compared to the default ones, having to set them each time can be inconvenient - this PR addresses that issue.

Screencast

Checklist

… settings synchronization across features and ensured wallpaper submission is only available after artwork image loads. Added new TypeScript definitions for extension preferences.
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: ascii-art-wallpaper Issues related to the ascii-art-wallpaper extension platform: macOS labels Mar 28, 2026
@raycastbot

raycastbot commented Mar 28, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

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

📋 Quick checkout commands
BRANCH="ext/ascii-art-wallpaper"
FORK_URL="https://github.com/alexi-build/raycast-extensions.git"
EXTENSION_NAME="ascii-art-wallpaper"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

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

@alexi-build
alexi-build marked this pull request as ready for review March 28, 2026 00:10
@greptile-apps

greptile-apps Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves settings persistence for the ASCII Art Wallpaper extension by introducing a shared setAutoSettings helper and refactoring WallpaperSettings to eagerly save settings on every dropdown change, keeping color mode, background, text color, and density in sync across all three commands. It also gates form submission until the artwork image has fully loaded, preventing premature wallpaper generation.

Key changes:

  • auto-settings.ts: Added setAutoSettings to centralise write logic alongside getAutoSettings.
  • auto-wallpaper.tsx: Swapped inline LocalStorage.setItem for the new helper — no functional change.
  • search-artworks.tsx: Settings and image loading are split into separate, cancellable useEffect hooks; dropdowns are now controlled components with onChange handlers that persist eagerly; an imageStatus state gates form submission until the image is ready.
  • CHANGELOG.md: New entry added, but uses a hardcoded date (2026-03-27) instead of the required {PR_MERGE_DATE} placeholder — this needs to be corrected before merging.
  • package.json: Contributor entry added for alexi.build.

Confidence Score: 4/5

Safe to merge once the hardcoded changelog date is replaced with the {PR_MERGE_DATE} placeholder.

One P1 issue blocks merge: the changelog entry uses a literal date instead of the standard {PR_MERGE_DATE} template variable required by the Raycast release process. The core logic changes are well-structured and correct; the stale-closure concern on the onChange handlers is a minor edge case (P2) that does not block merging.

extensions/ascii-art-wallpaper/CHANGELOG.md — hardcoded date must be replaced with {PR_MERGE_DATE}.

Important Files Changed

Filename Overview
extensions/ascii-art-wallpaper/CHANGELOG.md New changelog entry added but uses a hardcoded date 2026-03-27 instead of the required {PR_MERGE_DATE} placeholder.
extensions/ascii-art-wallpaper/src/auto-settings.ts Clean addition of setAutoSettings helper to centralise write logic alongside the existing getAutoSettings.
extensions/ascii-art-wallpaper/src/auto-wallpaper.tsx Refactored to use the new setAutoSettings helper instead of inline LocalStorage.setItem; no functional changes.
extensions/ascii-art-wallpaper/src/search-artworks.tsx Settings and image loading split into separate effects with proper cancellation; dropdowns are now controlled with eager-persist onChange handlers; stale-closure risk exists when multiple dropdowns are changed in rapid succession.
extensions/ascii-art-wallpaper/package.json Added alexi.build to contributors; no other functional changes.
extensions/ascii-art-wallpaper/package-lock.json Removed "peer": true flags from several dev-dependency entries; lock-file cleanup, no runtime impact.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/ascii-art-wallpaper/CHANGELOG.md
Line: 3

Comment:
**Hardcoded date instead of `{PR_MERGE_DATE}` placeholder**

The changelog entry uses a hardcoded date `2026-03-27` instead of the required `{PR_MERGE_DATE}` template placeholder. Raycast populates the merge date automatically during release — hardcoding a date will cause it to appear incorrect in the store.

```suggestion
## [Add Settings Persistence] - {PR_MERGE_DATE}
```

**Rule Used:** What: Changelog entries must use `{PR_MERGE_DATE}`... ([source](https://app.greptile.com/review/custom-context?memory=c2214c11-df56-490a-b1c0-09a385df481a))

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/ascii-art-wallpaper/src/search-artworks.tsx
Line: 249

Comment:
**Stale closure risk in `onChange` handlers**

Each `onChange` spreads the `settings` value captured at render time. If two dropdowns are changed in rapid succession before React flushes the state update from the first change, the second handler will spread the stale (pre-first-change) `settings` — silently discarding the first change from the persisted value.

The same pattern is present on all four dropdowns (lines 249, 259, 272, 285). Consider using a functional state update or a `useRef` to hold the latest settings to avoid this window:

```typescript
// option: use a ref that stays in sync with state
const settingsRef = useRef(settings);
useEffect(() => { settingsRef.current = settings; }, [settings]);

// then in onChange:
onChange={(value) => void persistSettings({ ...settingsRef.current!, colorMode: value })}
```

This is hard to trigger in normal usage but worth guarding against given that settings are persisted to LocalStorage on every change.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Enhance settings persistence and artwork..." | Re-trigger Greptile

- Refactor settings persistence in WallpaperSettings component. Introduced a ref to maintain current settings state, ensuring updates are applied correctly across various settings changes.
- Update CHANGELOG with the merge date for settings persistence enhancements and artwork submission improvements.
@0xdhrv 0xdhrv self-assigned this Apr 2, 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 756e9da into raycast:main Apr 2, 2026
2 checks passed
@github-actions

github-actions Bot commented Apr 2, 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 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: ascii-art-wallpaper Issues related to the ascii-art-wallpaper extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants