Skip to content

Add etymology extension - #31246

Open
Chiarandini wants to merge 5 commits into
raycast:mainfrom
Chiarandini:ext/etymology
Open

Chiarandini wants to merge 5 commits into
raycast:mainfrom
Chiarandini:ext/etymology

Conversation

@Chiarandini

@Chiarandini Chiarandini commented Sep 18, 2026

Copy link
Copy Markdown

Description

Etymology traces where a word comes from, one ancestor at a time.

An entry opens with what the word means, then a table of its line of descent — each step marked as inherited, borrowed, a calque, or a component. Pressing enter on any ancestor opens it as its own entry, so you can walk from computer back through Latin computō to Proto-Indo-European *ḱe.

Commands

  • Search Etymology — search with a live preview while you arrow through results
  • Look up Selection — the etymology of whatever text is selected
  • Show Random Etymology — a random word that has a full derivation tree
  • AI tool Get Etymology, exposing the same data to Raycast AI

Where the data comes from

English Wiktionary, via the public MediaWiki API. No account, no API key, no tracking. Results are cached for 30 days, and the extension reads ancestry two ways:

  • Entries using {{etymon|tree=1}} carry a machine-readable ancestor tree in the rendered page, assembled by Wiktionary from each ancestor's own entry. Around 46,000 English entries have one, and it reaches deeper than any single page states.
  • Everything else is read from the derivation templates in the wikitext ({{inh}}, {{bor}}, {{der}}, {{affix}}, and the rest).

Definitions come out of the same request, so showing what a word means costs no extra call.

Attribution — Wiktionary content is CC BY-SA 4.0. Every entry shows the source and licence in the metadata pane with a link back to the page, and the copy actions carry the attribution line.

Etymonline is linked to via an optional action and never reproduced: it has no public API and its entries are proprietary.

Screencast

Six screenshots in metadata/: the search list with its preview pane, and detail views for sarcasm (a deep Greek chain), cereal (borrowed and analysable as Cere(s) + -al), computer (definitions, then the full chain with its side branches named), and quixotic.

Checklist

- Recapture the search-list screenshot
- Store screenshots
- Version the cache key on parser changes
- Use the root-system icon
- Fix four defects the store screenshots exposed
- Check branch and clean tree before publishing
- Hoist the markdown, and return to main after just local
- Guard the local-branch rebase, and document the split
- Add the two-branch workflow to the justfile
- Move the Etymonline excerpt off main
- Add a justfile and install docs
- Add definitions, and an Etymonline excerpt for local builds
- Render the tree as a table, and quiet the attribution
- Rework the detail pane
- Implement the extension over Wiktionary
- scaffold: Etymology Raycast extension layout
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

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

Once the PR is approved and merged, the extension will be available on our Store.

@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The code behavior appears safe, but the title case rule must be fixed before merge.

Findings

  1. P1 key lowercases a title even though fetchWithCaseFallback relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached Entry , including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in favorites.same , so both places should use the same case-sensitive rule.
  2. P2 Selection title breaks title case
  3. P2 This update deletes scripts/check-store-ready.mjs and removes store-check , but package.json still exposes npm run check-store-ready . That command now exits with a missing-file error. Remove the package script too, or restore its file.
Fix with agent prompt
### Issue 1
extensions/etymology/src/cache.ts:27-28
`key()` lowercases a title even though `fetchWithCaseFallback()` relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached `Entry`, including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in `favorites.same()`, so both places should use the same case-sensitive rule.

### Issue 2
extensions/etymology/package.json:26
The `lookup-selection` command uses `Look up Selection`. The repository requires titles in `package.json` to use title case. Change it to `Look Up Selection`.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 3
extensions/etymology/justfile:undefined-96
This update deletes `scripts/check-store-ready.mjs` and removes `store-check`, but `package.json` still exposes `npm run check-store-ready`. That command now exits with a missing-file error. Remove the package script too, or restore its file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds an Etymology extension for tracing English words through their Wiktionary ancestors. It provides searchable entries, definitions, ancestry trees, copying and pinning actions, selection and random lookup, and a matching AI tool.

  • Reads ancestry from Wiktionary wikitext and rendered trees.
  • Shows definitions, relation marks, branches, roots, and source attribution.
  • Adds caching, previews, ancestor navigation, favorites, and formatted copying.
  • Includes setup, publishing, documentation, assets, and parser checks.

Reviews (4) · Last reviewed commit: "Second review pass"

Comment thread extensions/etymology/src/cache.ts Outdated
Comment on lines +27 to +28
function key(term: string, lang: string): string {
return `v${PARSE_VERSION}:${lang}:${term.toLowerCase()}`;

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.

P1 key() lowercases a title even though fetchWithCaseFallback() relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached Entry, including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in favorites.same(), so both places should use the same case-sensitive rule.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/src/cache.ts
Line: 27-28

Comment:
`key()` lowercases a title even though `fetchWithCaseFallback()` relies on Wiktionary's case-sensitive titles. A lookup for another case variant can therefore return the first cached `Entry`, including its term and source link, for 30 days. Keep case in the identity key. The same collision exists in `favorites.same()`, so both places should use the same case-sensitive rule.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread extensions/etymology/src/sources/index.ts
Comment thread extensions/etymology/src/components/EntryDetail.tsx
Comment thread extensions/etymology/src/search-etymology.tsx Outdated
Comment thread extensions/etymology/src/preferences.ts Outdated
Comment thread extensions/etymology/.prettierrc Outdated
# Run before committing.
check: types lint parsers

# Run this after any change to main if you want those additions on your machine.

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.

P2 This update deletes scripts/check-store-ready.mjs and removes store-check, but package.json still exposes npm run check-store-ready. That command now exits with a missing-file error. Remove the package script too, or restore its file.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/justfile
Line: 96

Comment:
This update deletes `scripts/check-store-ready.mjs` and removes `store-check`, but `package.json` still exposes `npm run check-store-ready`. That command now exits with a missing-file error. Remove the package script too, or restore its file.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

- Move working notes to .claude/
- Address the automated review
Comment thread extensions/etymology/eslint.config.js Outdated
},
{
"name": "lookup-selection",
"title": "Look up Selection",

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.

P2 The lookup-selection command uses Look up Selection. The repository requires titles in package.json to use title case. Change it to Look Up Selection.

Rule Used: What: Use title case for titles in package.json. Why: Title case improves readability and maintains consistent formatting standards for user-facing preference labels. Good: json { "title": "Tab width configuration", } Bad: ```json { "... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/etymology/package.json
Line: 26

Comment:
The `lookup-selection` command uses `Look up Selection`. The repository requires titles in `package.json` to use title case. Change it to `Look Up Selection`.

**Rule Used:** What: Use title case for titles in `package.json`.  Why: Title case improves readability and maintains consistent formatting standards for user-facing preference labels.  Good: ```json {   "title": "Tab width configuration", } ```  Bad: ```json {   "... ([source](https://app.greptile.com/raycast/-/custom-context?memory=a44fb089-4d03-4b60-a4ff-03431cdf0eb4))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Keeping Look up Selection here, because ray lint requires it. Changing it to Look Up Selection makes the linter fail:

26:15  warning  Command's title has to be Title Cased. Expected "Look up Selection"

The current title lints clean. The other two findings in this round look like they were computed against an earlier commit — src/cache.ts already keys case-sensitively (v${PARSE_VERSION}:${lang}:${term}, no toLowerCase, and favorites.same() matches), and the check-store-ready script was removed from package.json in the same push that deleted the 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.

Thanks for the clarification. The linter output confirms that Look up Selection is the repository's expected title casing, so my finding on extensions/etymology/package.json is incorrect—please keep the current title. The cache and check-store-ready findings are also stale relative to the current commit and should be dismissed.

@Chiarandini
Chiarandini marked this pull request as ready for review September 18, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants