Skip to content

Add Manage Text Replacements command#27349

Merged
raycastbot merged 11 commits intoraycast:mainfrom
jake-fowler-lego-nerd:feat/manage-text-replacements
Apr 30, 2026
Merged

Add Manage Text Replacements command#27349
raycastbot merged 11 commits intoraycast:mainfrom
jake-fowler-lego-nerd:feat/manage-text-replacements

Conversation

@jake-fowler-lego-nerd
Copy link
Copy Markdown
Contributor

Description

Adds a new 'Manage Text Replacements' command that lets users search, copy, add, edit, and delete native macOS text replacements directly from Raycast. Changes sync back to System Settings via defaults import.

Screencast

shortcut list screenshot

Checklist

Adds a new 'Manage Text Replacements' command that lets users search,
copy, add, edit, and delete native macOS text replacements directly
from Raycast. Changes sync back to System Settings via defaults import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: text-replacements Issues related to the text-replacements extension platform: macOS labels Apr 22, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

raycastbot commented Apr 22, 2026

Thank you for your contribution! 🎉

🔔 @thomaslombart 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="feat/manage-text-replacements"
FORK_URL="https://github.com/jake-fowler-lego-nerd/extensions.git"
EXTENSION_NAME="text-replacements"
REPO_NAME="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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR adds a Manage Text Replacements command that lets users search, copy, add, edit, and delete native macOS text replacements directly from Raycast, syncing changes back via defaults import. The implementation is solid — previously raised concerns (duplicate-shortcut check on edit, unique temp files, empty-list handling, stale-UI on notifySystem failure) have all been addressed. The only finding is a hardcoded date in CHANGELOG.md that should be the {PR_MERGE_DATE} placeholder.

Confidence Score: 5/5

Safe to merge after fixing the changelog placeholder.

Only P2 findings present; all previously raised P0/P1 concerns have been addressed in the current code.

extensions/text-replacements/CHANGELOG.md — fix the hardcoded date to {PR_MERGE_DATE}.

Important Files Changed

Filename Overview
extensions/text-replacements/src/manage-text-replacements.tsx New command implementing search/add/edit/delete of macOS text replacements via SQLite; issues flagged in previous threads have been addressed (duplicate-shortcut check on edit, unique tmpfile for notifySystem, empty-list EmptyView, WAL checkpoint, finally refresh).
extensions/text-replacements/CHANGELOG.md New entry uses a hardcoded date (2026-04-30) instead of the required {PR_MERGE_DATE} placeholder.
extensions/text-replacements/package.json Adds new view command, updates description and category to System, and pins platforms to macOS; all looks correct.
extensions/text-replacements/README.md Trivial whitespace fix (adds trailing newline).
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/text-replacements/CHANGELOG.md:3
**Hardcoded date instead of `{PR_MERGE_DATE}` placeholder**

The new entry uses `2026-04-30` as the date. Per the Raycast extension changelog convention, new entries must use the `{PR_MERGE_DATE}` placeholder, which is automatically replaced with the actual merge date during release.

```suggestion
## [Manage Text Replacements] - {PR_MERGE_DATE}
```

Reviews (10): Last reviewed commit: "Update CHANGELOG.md and add platforms fi..." | Re-trigger Greptile

Comment thread extensions/text-replacements/src/manage-text-replacements.tsx
Comment thread extensions/text-replacements/src/manage-text-replacements.tsx Outdated
Comment thread extensions/text-replacements/src/manage-text-replacements.tsx
jake-fowler-lego-nerd and others added 2 commits April 22, 2026 08:29
- Add List.EmptyView with Add New action so users can create their first
  replacement even when the list is empty (P1)
- Use timestamp-suffixed temp file in notifySystem() to prevent
  write-write race on rapid successive saves (P2)
- Resolve Z_ENT dynamically via Z_PRIMARYKEY.Z_NAME instead of
  hardcoding 1, guarding against CoreData schema changes (P2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread extensions/text-replacements/src/manage-text-replacements.tsx Outdated
jake-fowler-lego-nerd and others added 3 commits April 23, 2026 13:38
- Switch loadReplacements to --json mode so newlines inside ZPHRASE
  don't corrupt row parsing (e.g. email signature expansions)
- Use Form.TextArea for expansion field to support multi-line input
- Clean up temp plist file after defaults import
- Use --json for getZEnt query for consistency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevent duplicate shortcut inserts, reset loading state for every refresh, and sanitize XML-illegal control characters before plist import.

Made-with: Cursor
@0xdhrv
Copy link
Copy Markdown
Contributor

0xdhrv commented Apr 30, 2026

@greptile review

Comment thread extensions/text-replacements/src/manage-text-replacements.tsx
Reuse shortcut conflict detection in update flow while excluding the current row to avoid creating duplicate active shortcuts.

Made-with: Cursor
Comment thread extensions/text-replacements/src/manage-text-replacements.tsx
0xdhrv added 2 commits April 30, 2026 17:02
… on paste action

- Change category from "Applications" to "System" in package.json for better classification.
- Add a HUD notification after pasting a text replacement to improve user experience.
Comment thread extensions/text-replacements/src/manage-text-replacements.tsx
- Move onSave() call to the finally block to guarantee it executes regardless of success or failure during the save process.
- Enhance user feedback by ensuring the save state is consistently updated.
@0xdhrv 0xdhrv self-assigned this Apr 30, 2026
Copy link
Copy Markdown
Contributor

@0xdhrv 0xdhrv left a comment

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 522d04d into raycast:main Apr 30, 2026
3 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/raycast/text-replacements

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

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: text-replacements Issues related to the text-replacements extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants