fix: truncate long project names in pinned card#525
Conversation
WalkthroughThe pull request refactors the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@echo/frontend/src/components/project/PinnedProjectCard.tsx`:
- Around line 82-94: The ActionIcon used as the icon-only unpin control
(ActionIcon with IconPinFilled and onUnpin) lacks an accessible name; add an
explicit accessible label by passing a descriptive prop such as
aria-label="Unpin project" (or aria-labelledby pointing to a visible label) to
the ActionIcon so screen readers can announce the control, and keep existing
onClick, loading, and event-prevention logic unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4aed1d64-3623-4f7f-b62b-46686a5f4e4f
📒 Files selected for processing (8)
echo/frontend/src/components/project/PinnedProjectCard.tsxecho/frontend/src/locales/de-DE.poecho/frontend/src/locales/en-US.poecho/frontend/src/locales/es-ES.poecho/frontend/src/locales/fr-FR.poecho/frontend/src/locales/it-IT.poecho/frontend/src/locales/nl-NL.poecho/frontend/src/locales/uk-UA.po
| <ActionIcon | ||
| variant="subtle" | ||
| color="primary" | ||
| size="sm" | ||
| loading={isUnpinning} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| e.stopPropagation(); | ||
| onUnpin(project.id); | ||
| }} | ||
| > | ||
| <IconPinFilled size={16} /> | ||
| </ActionIcon> |
There was a problem hiding this comment.
Add an accessible name to the icon-only unpin control.
At Line 82, the ActionIcon is icon-only and currently has no explicit accessible name. Tooltip text is not a reliable accessible label for all assistive tech paths.
⚡ Suggested fix
<Tooltip label={t`Unpin project`}>
<ActionIcon
+ aria-label={t`Unpin project`}
variant="subtle"
color="primary"
size="sm"
loading={isUnpinning}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <ActionIcon | |
| variant="subtle" | |
| color="primary" | |
| size="sm" | |
| loading={isUnpinning} | |
| onClick={(e) => { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| onUnpin(project.id); | |
| }} | |
| > | |
| <IconPinFilled size={16} /> | |
| </ActionIcon> | |
| <Tooltip label={t`Unpin project`}> | |
| <ActionIcon | |
| aria-label={t`Unpin project`} | |
| variant="subtle" | |
| color="primary" | |
| size="sm" | |
| loading={isUnpinning} | |
| onClick={(e) => { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| onUnpin(project.id); | |
| }} | |
| > | |
| <IconPinFilled size={16} /> | |
| </ActionIcon> | |
| </Tooltip> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@echo/frontend/src/components/project/PinnedProjectCard.tsx` around lines 82 -
94, The ActionIcon used as the icon-only unpin control (ActionIcon with
IconPinFilled and onUnpin) lacks an accessible name; add an explicit accessible
label by passing a descriptive prop such as aria-label="Unpin project" (or
aria-labelledby pointing to a visible label) to the ActionIcon so screen readers
can announce the control, and keep existing onClick, loading, and
event-prevention logic unchanged.
Summary by CodeRabbit
Release Notes
Style
Refactor