Skip to content

Add duden extension#26573

Open
ahinderling wants to merge 3 commits intoraycast:mainfrom
ahinderling:ext/duden
Open

Add duden extension#26573
ahinderling wants to merge 3 commits intoraycast:mainfrom
ahinderling:ext/duden

Conversation

@ahinderling
Copy link
Copy Markdown

@ahinderling ahinderling commented Mar 23, 2026

Description

Lookup lemma from the online DUDEN (German language dictionary)

Screencast

Checklist

@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 10-15 business days.

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

- update title to proper case
- Fix TypeScript cache type error
- removed obsolete asset file
@ahinderling ahinderling marked this pull request as ready for review March 23, 2026 10:09
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR adds a new Duden extension that lets users search German words on Duden.de directly from Raycast. The extension scrapes Duden.de using Cheerio, applies in-memory caching (30-minute TTL), and displays rich word details (pronunciation, meaning, synonyms, etymology, etc.) in a Detail view.

Key issues found:

  • Navigation is broken (src/search-duden-de.tsx): Selecting a word conditionally renders <WordDetails> as the root component instead of using useNavigation().push(). Since Raycast has no navigation context, pressing Escape exits the extension entirely — users cannot return to the search results to look up another word in the same session. This applies both to manual word selection and the single-result auto-navigation path.
  • Changelog uses a hardcoded date instead of the required {PR_MERGE_DATE} placeholder (CHANGELOG.md).
  • Double debouncing (search-duden-de.tsx): The throttle prop on <List> (≈300 ms) combined with the manual setTimeout(…, 300) in useEffect results in ~600 ms effective delay before each search request. One of the two debounce mechanisms should be removed.
  • Category Productivity should be Documentation (package.json): A dictionary/reference-lookup tool is a better fit for the Documentation category (documentation search and reference tools) than Productivity.

Confidence Score: 2/5

  • Not safe to merge — the navigation pattern breaks the core user flow after viewing a word.
  • The P1 navigation bug means users cannot return to the search list after opening a word detail; they must close and reopen the extension every time. This breaks the primary user path (search → view details → search again), which warrants blocking the merge until fixed alongside the other P2 items.
  • extensions/duden/src/search-duden-de.tsx requires the most attention for the navigation fix.

Important Files Changed

Filename Overview
extensions/duden/src/search-duden-de.tsx Main search command; has a P1 navigation bug — conditionally rendering WordDetails instead of using useNavigation().push() means pressing Escape exits the extension rather than returning to results. Also contains double-debouncing (throttle + manual setTimeout).
extensions/duden/src/api/duden.ts HTTP client with in-memory cache, timeout handling, and search/detail fetching. Logic is clear and correct.
extensions/duden/src/utils/parser.ts Cheerio-based HTML parser for word detail and search result pages; selectors closely follow the Python duden project patterns. Fragile by nature (web scraping), but the implementation is reasonable.
extensions/duden/src/components/WordDetails.tsx Detail view with markdown rendering and an action panel. No back action needed once navigation is fixed via useNavigation in the parent. Clean implementation.
extensions/duden/src/types/duden.ts Type definitions for DudenWord, SearchResult, DudenApiError, and CacheEntry. Well-structured; the meaningOverview union type is broader than needed (parser always returns string) but harmless.
extensions/duden/package.json Extension manifest; category Productivity should be Documentation for a dictionary/reference tool. All other fields (platforms, commands, dependencies) look correct.
extensions/duden/CHANGELOG.md Changelog entry uses a hardcoded date (2026-03-23) instead of the required {PR_MERGE_DATE} placeholder.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/duden/src/search-duden-de.tsx
Line: 74-76

Comment:
**No back navigation from word details**

When `selectedWord` is set, the command returns `<WordDetails>` as the root component. Because this is a conditional render rather than a navigation push, pressing Escape will exit the extension entirely instead of returning to the search results. Users have no way to go back to the list and look up another word in the same session.

The idiomatic fix is to use `useNavigation().push()` to push the detail view onto the navigation stack:

```typescript
import { useNavigation } from "@raycast/api";

const { push } = useNavigation();

const handleWordSelection = async (result: SearchResult) => {
  setIsLoading(true);
  try {
    const word = await getWordDetails(result.urlname);
    push(<WordDetails word={word} />);
  } catch (error) {
    // ...
  } finally {
    setIsLoading(false);
  }
};
```

This gives Raycast proper navigation context so Escape pops back to the list. The same change applies to the auto-navigation for a single result (`singleWord`) on lines 33–34.

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/duden/CHANGELOG.md
Line: 8

Comment:
**Changelog date should use `{PR_MERGE_DATE}` placeholder**

The changelog entry uses a hardcoded date instead of the required `{PR_MERGE_DATE}` placeholder. The merge date is populated automatically when the PR is merged.

```suggestion
## [Initial Version] - {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/duden/src/search-duden-de.tsx
Line: 84

Comment:
**Double debouncing: `throttle` + manual `setTimeout`**

The `throttle` prop on `<List>` already defers `onSearchTextChange` by ~300 ms. Combined with the manual `setTimeout(…, 300)` in the `useEffect`, the effective delay before a network request is roughly 600 ms (or more). Remove either the `throttle` prop or the manual debounce to avoid double-throttling.

```suggestion
      searchBarPlaceholder="Search German words on Duden.de (minimum 3 characters)..."
```

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/duden/package.json
Line: 12-15

Comment:
**Category `Productivity` is not the best fit**

`Productivity` is meant for task management and personal productivity tools (e.g., Todoist). A dictionary/reference lookup extension fits `Documentation` (documentation search and reference tools) more precisely. `Web` is appropriate as a secondary category since the extension searches a website.

```suggestion
  "categories": [
    "Documentation",
    "Web"
  ],
```

**Rule Used:** What: Assign at least one predefined category to e... ([source](https://app.greptile.com/review/custom-context?memory=f49debbf-b6f6-4c0d-9b35-e1927815992b))

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

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

- Remove unused DudenWord import
- Fix double debouncing: Remove manual setTimeout, keep throttle prop
- Fix navigation: Use Raycast navigation stack instead of conditional rendering
- use \'Documentation\' as primary category
- use {PR_MERGE_DATE} placeholder in changelog
@raycastbot
Copy link
Copy Markdown
Collaborator

This pull request has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 7 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Apr 6, 2026
@ahinderling
Copy link
Copy Markdown
Author

👋 this is not stale - just waiting for review

@raycastbot raycastbot removed the status: stalled Stalled due inactivity label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants