Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Options Selector to Replace LanguageSelector #84

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

spergel
Copy link

@spergel spergel commented Feb 13, 2025

Add Options Selector and Wiki Options Management

New Components and Logic

OptionsSelector Component (OptionsSelector.tsx)

Created a new settings modal component to replace language selection:

  • Language & Categories tabs
  • Expandable category trees with subcategories

Wiki Options Hook (useWikiOptions.ts)

Implemented a custom hook for managing Wikipedia article fetching and options:

  • Language & Category selection
  • Fetching a bunch of different categories is slow so I tried some optimizations
    • Batch size optimization (10 articles per category)
    • Parallel fetching (3 concurrent requests)
  • Automatic content refresh on language/category changes after saving & closing

Categories Definition (categories.ts)

Added a comprehensive category system to be used for OptionsSelector / useWikiOptions

  • 12 main categories (Arts, Science, Technology, etc.)
  • Each category includes:
    • Translations in 24 languages (also the cause of why the changelog is so large)
    • Custom icons
    • 5-7 subcategories per main category (translated for each language)

Removed useLocalization.ts , useWikiArticles.ts, and LanguageSelector.tsx

  • useLocalization.ts , useWikiArticles.ts' functionalities merged into useWikiOptions.ts`
  • 'LanguageSelector.tsx' replaced by the more comprehensive OptionsSelector.tsx

Unsure if this is the direction intended for the project but at least a possibility

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wikitok ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 0:49am

@spergel spergel changed the title Feat/options Feat: Options Selector to Replace LanguageSelector Feb 13, 2025
@spergel
Copy link
Author

spergel commented Feb 13, 2025

This is a pretty crude way of implementing this functionality. If there is interest in implementing this, ill try to improve both the speed of getting the articles and mucking around with how much each category covers.

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