feat: add custom text input via tabbed InputBar #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a "Paste Text" tab to the InputBar so users can paste raw text directly for reading and translation, without needing a URL from a supported website. Useful for classical texts, poetry, sutras, or anything not hosted online.
How it works
The InputBar gains two tabs: From URL (existing behavior, unchanged) and Paste Text (new). The paste tab has fields for title, source language, and a textarea for content. The landing page heading and divider text are updated to be mode-neutral.
Under the hood,
importCustomTextconstructs anImportedChapterwith a synthetic URL (custom.lexiconforge.local/text/{timestamp}) and feeds it into the existingtransformImportedChapters→ImportOps.importStableSessionData→ Zustand store merge pipeline. No changes to adapters, navigation service, stable ID generation, or persistence layer.Files changed
components/InputBar.tsx— Tabbed UI: "From URL" / "Paste Text". All existing URL-mode behavior preserved identically.components/LandingPage.tsx— Updated heading, subtitle, and divider to be mode-neutral ("Translate Any Text", "OR START FROM SCRATCH").store/slices/chaptersSlice.ts— NewimportCustomTextaction onChaptersActionsinterface + implementation.services/telemetryService.ts— Unrelated bugfix:crypto.randomUUID()fallback for non-HTTPS contexts.What doesn't change
services/adapters.ts— custom text bypasses adapters entirelyservices/navigationService.ts— the store action handles everything directlyservices/stableIdService.ts—transformImportedChaptersworks as-is with synthetic URLsservices/db/operations/imports.ts—importStableSessionDataworks as-istypes.ts—ImportedChapter,EnhancedChapteralready have all needed fieldsTest plan