📌 Description
UserProfileDropdown (src/shared/components/UserProfileDropdown.tsx) assumes user.github?.avatar_url exists, hardcodes navigation paths, and has no tests. A missing avatar or long username can break the UI.
💡 Why it matters: The account menu is shown app-wide and must handle missing avatars gracefully.
🧩 Requirements and context
- Add a fallback when
avatar_url is missing (initials/placeholder).
- Add
title for truncated usernames.
- Add tests for authenticated vs unauthenticated (Sign In) rendering and menu actions.
- Extract hardcoded paths into shared route constants where practical.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b test/userprofiledropdown
2. Implement changes
- Write/modify the relevant source:
src/shared/components/UserProfileDropdown.tsx
- Write comprehensive tests:
src/shared/components/UserProfileDropdown.test.tsx
- Add documentation: inline TSDoc
- Include TSDoc doc comments
- Validate security assumptions: n/a
3. Test and commit
- Cover edge cases: missing avatar, long username, signed out
- Include test output and security notes in the PR description.
Example commit message
test(userprofile): coverage + avatar fallback
✅ Acceptance criteria
🔒 Security notes
None.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
UserProfileDropdown(src/shared/components/UserProfileDropdown.tsx) assumesuser.github?.avatar_urlexists, hardcodes navigation paths, and has no tests. A missing avatar or long username can break the UI.🧩 Requirements and context
avatar_urlis missing (initials/placeholder).titlefor truncated usernames.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/shared/components/UserProfileDropdown.tsxsrc/shared/components/UserProfileDropdown.test.tsx3. Test and commit
npm run testExample commit message
✅ Acceptance criteria
🔒 Security notes
None.
📋 Guidelines