Fit long study names on every surface that shows one - #817
Merged
Merged
Conversation
Study names arrive from citation titles and filenames and routinely run past 200 characters. Each surface now clips to one line and offers the full name when it is actually cut: - TruncatedText and useIsTruncated: single-line text with a tooltip that only mounts while the text is clipped. Used by the to-do, completed, reconcile and assign-reviewers rows and both overview results tables. - InlineEdit gains a truncate flag so the study card header and study sheet title clip instead of wrapping into the reviewer avatars. - Overview results tables cap the study column so a long name cannot push the judgement pills behind the horizontal scrollbar. - TrafficLightChart fits labels to a 240px margin instead of a blind 20-character cut, keeping the full name as an SVG title. - PDF export fits section header text to the bar width; jsPDF neither wraps nor clips on its own. - fitToWidth is the shared estimate-then-shrink fitter behind the chart and the PDF. The ResizeObserver test mock becomes a function expression because vitest 4 rejects new on an arrow-function implementation. Closes #815
|
Warning Review limit reachedNext included review available in 44 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (18)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #815.
Study names arrive from citation titles and PDF filenames and routinely run past 200 characters. Every surface that shows one handled it differently and none handled it well: the card header wrapped into the reviewer avatars, three tabs cut the name with no way to read it, the results tables shoved the judgement pills behind a scrollbar, the charts cut at 20 characters, and the PDF export ran off the page.
What changes
TruncatedText+useIsTruncated: single-line text whose tooltip only mounts while the text is actually clipped, so short names stay quiet. Used by the to-do, completed, reconcile and assign-reviewers rows and both overview results tables.InlineEditgainstruncate: the study card header and study sheet title clip to one line with the same tooltip instead of wrapping. Callers that want the whole value (descriptions) are unchanged.<title>for hover.fitToWidth: one shared estimate-then-shrink fitter behind the chart and the PDF, so both take a couple of measurements per name rather than one per character.The ResizeObserver mock in the test setup becomes a function expression because vitest 4 rejects
newon an arrow-function implementation.Not in this PR
Containing names at the source (defaulting new studies to an author-year name such as "Smith 2019") is a separate follow-up. It shortens the common case but does not remove the need for these fallbacks, since a bare PDF with no extractable metadata still lands on the filename.
Verification
pnpm typecheck,pnpm lint: cleanpnpm --filter web test: 56 files, 584 tests pass, including one test each forTruncatedTextandfitToWidth