Created
April 10, 2026 06:32
-
-
Save TosinAF/a3a3f77143765cdacc299910039bc554 to your computer and use it in GitHub Desktop.
i18n Phase 2: Unwrapped HTML help text blocks in workflow constants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # i18n Phase 2: HTML Help Text Blocks | |
| ## Context | |
| As part of an i18n audit of the Harvey frontend, we identified ~23 large HTML help text blocks that contain user-facing content with zero Lingui wrapping. These are more complex than simple string wrapping (Phase 1) because they contain multi-paragraph HTML with inline formatting. | |
| This doc covers the 7 blocks in `src/components/workflows/constants.ts`. There are also 16 similar blocks in `src/components/research/constants.tsx` (not covered here). | |
| --- | |
| ## How They're Used | |
| All 7 constants follow the same pattern — they're **fallback help content**. Example from `translation-page.tsx`: | |
| ```tsx | |
| emptyStateText={ | |
| userInfo.GetHelpPanel(WorkflowTypeToTaskType[workflowType]) | |
| ?.content ?? TRANSLATION_HELP // <-- fallback if backend returns nothing | |
| } | |
| ``` | |
| The backend can serve dynamic help content via `GetHelpPanel()`. These constants only render when the backend hasn't provided custom content for that workflow. | |
| --- | |
| ## The 7 Blocks | |
| ### 1. `REDLINES_HELP` (lines 129-178) — ~50 lines, largest | |
| - **About** section: what Redline Q&A does | |
| - **Tips** (5 bullets): how to get best results | |
| - **Important reminders** (8 bullets): limitations (PDF format, not generating redlines, etc.) | |
| - **Example queries** (7 detailed legal scenarios): NDA, Merger Agreement, Leases, IP, Employment, Disclosure Schedules | |
| ### 2. `TRANSLATION_HELP` (lines 180-187) — ~8 lines | |
| - About section + 3 tips about formatting retention and human review | |
| ### 3. `COMPANY_PROFILE_HELP` (lines 189-201) — ~13 lines | |
| - SEC/EDGAR company profiling. Tips (2 bullets) + reminders (3 bullets) about search limitations (10-K, 14A, 8-K only) | |
| ### 4. `LEGACY_DRAFTING_HELP` (lines 203-211) — ~9 lines | |
| - Precedent comparison chart. 3 reminder bullets. **Note: "legacy" in the name — possibly deprecated.** | |
| ### 5. `OGC_REVIEW_HELP` (lines 213-220) — ~8 lines | |
| - OGC Contract Review tips. 5 bullets about upload limits, 300-page cap, column reading limitations. | |
| ### 6. `ISSUES_LIST_HELP` (lines 222-239) — ~18 lines | |
| - Redline Analysis Issues List. Tips on topic selection + 7 reminder bullets. Overlaps heavily with `REDLINES_HELP`. | |
| ### 7. `DILIGENCE_TRANSCRIPTS_HELP` (lines 241-250) — ~10 lines | |
| - Interview Summaries workflow. About + 5 tips on uploading transcripts/audio. | |
| --- | |
| ## Content Characteristics | |
| - **Static marketing/onboarding copy** — describes what each tool does and how to use it | |
| - **Heavy legal domain content** — example queries reference specific legal scenarios | |
| - **Inline HTML** with Quill editor classes (`ql-align-justify`) and inline styles (`style="font-size: 14px;"`) | |
| - **~120 lines of HTML content** total across all 7 blocks | |
| - One is explicitly **"legacy"** (`LEGACY_DRAFTING_HELP`) | |
| --- | |
| ## Questions to Resolve | |
| 1. **Are these fallbacks ever actually hit?** If the backend always provides help content, these are dead code. | |
| 2. **Is `LEGACY_DRAFTING_HELP` still used?** The name suggests it may be deprecated. | |
| 3. **Should help content move to a CMS/backend entirely?** If so, localizing these constants is wasted effort. | |
| 4. **Are these workflows available to non-English users?** Some (SEC/EDGAR, OGC) seem US-specific. | |
| ## Localization Options (if needed) | |
| | Approach | Effort | Translator UX | Notes | | |
| |----------|--------|--------------|-------| | |
| | `msg` on whole HTML block | Low | Terrible (translators edit raw HTML) | Simple but error-prone | | |
| | Break into `t`/`msg` fragments | Medium | Good (plain text per fragment) | Requires reconstructing HTML around translated pieces | | |
| | Convert to React + `<Trans>` | High | Good | Most "correct" Lingui approach, biggest refactor | | |
| | Move to backend/CMS | High | Best (managed externally) | Eliminates the problem from frontend entirely | | |
| | Leave unwrapped | Zero | N/A | Acceptable if workflows are English-only or fallbacks are never hit | | |
| --- | |
| ## File Reference | |
| - `src/components/workflows/constants.ts` — lines 129-250 | |
| - Consumed by: `translation-page.tsx`, `redlines-page.tsx`, `company-profile/input-form.tsx`, `legacy-drafting-prompt-input.tsx`, `ogc-prompt-input.tsx`, `discovery/flow/index.tsx`, `diligence-transcripts-page.tsx` | |
| - Pattern: `userInfo.GetHelpPanel(...)?.content ?? CONSTANT_HELP` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment