Skip to content

Comments

Simplify translation history: log search_word, skip re-searches#907

Merged
mircealungu merged 5 commits intomasterfrom
feature/translation-history-v2
Feb 17, 2026
Merged

Simplify translation history: log search_word, skip re-searches#907
mircealungu merged 5 commits intomasterfrom
feature/translation-history-v2

Conversation

@mircealungu
Copy link
Member

Summary

  • logTranslationSearch now sends search_word instead of meaning_id
  • performSearch takes skipHistory param - true when navigating from history
  • Simplified history display (just search_word + time)
  • Uses date-fns formatDistanceToNow and existing styles from Translate.sc.js

Depends on

Test plan

  • Search for word → appears in history once (not twice)
  • Click history item → re-searches but doesn't add duplicate entry
  • History shows only searches for current learned language

🤖 Generated with Claude Code

mircealungu and others added 5 commits February 17, 2026 14:59
- Add getTranslationHistory() API method
- Implement TranslateHistory component showing recent searches
- Update Translate component to handle navigation from history
- Clicking history items triggers search for that word

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract res.data from apiGet response in getTranslationHistory
- Add eslint-disable for intentional empty deps array in useEffect

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract search logic into performSearch(word) function
- Call performSearch directly from history navigation useEffect
- Remove formRef since form submission is no longer needed for auto-search

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use formatDistanceToNow from date-fns instead of custom formatTimeAgo
- Reuse styles from Translate.sc.js (TranslationCard, NoResults, etc.)
- Reduced from 173 to 93 lines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- logTranslationSearch now sends search_word (not meaning_id)
- performSearch takes skipHistory param - true when from history
- Simplified history display (just search_word + time)
- Uses date-fns and existing styles from Translate.sc.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for voluble-nougat-015dd1 ready!

Name Link
🔨 Latest commit e9720b6
🔍 Latest deploy log https://app.netlify.com/projects/voluble-nougat-015dd1/deploys/6994c0771636aa0008f1fce5
😎 Deploy Preview https://deploy-preview-907--voluble-nougat-015dd1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mircealungu mircealungu merged commit 814b983 into master Feb 17, 2026
4 checks passed
@mircealungu mircealungu deleted the feature/translation-history-v2 branch February 17, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant