I've completed the investigation and planning for the External Dogs UI issues. I found that `ExternalDogs.jsx` used undefined CSS classes and a different layout than `DogList.jsx`. I've documented my findings and a proposed fix in [.zenflow/tasks/6e6e64eb-cb72-459e-b943-27554a749459/investigation.md](./.zenflow/tasks/6e6e64eb-cb72-459e-b943-27554a749459/investigation.md) and updated the [plan.md](./.zenflow/tasks/new-task-6e6e/plan.md).
2.1 KiB
2.1 KiB
Investigation - External Dogs UI Issues
Bug Summary
The "External Dogs" interface does not match the layout and style of the main "Dogs" page. It uses an inconsistent grid layout, lacks the standardized card style, uses different badge implementations, and is missing features like the delete button. Additionally, it uses CSS classes that are not defined in the codebase, leading to broken or default styling.
Root Cause Analysis
- Inconsistent Layout:
DogList.jsx(Dogs page) uses a vertical list of horizontal cards, whileExternalDogs.jsxuses a grid of square-ish cards. - Undefined CSS Classes:
ExternalDogs.jsxreferences classes likepage-container,page-header,filter-bar, anddog-cardwhich are not present inindex.cssorApp.css. - Missing Components:
ExternalDogs.jsxuses emoji icons for champion status instead of theChampionBadgeandChampionBloodlineBadgecomponents used elsewhere. - Feature Disparity: The Dogs page includes a delete button with a confirmation modal, which is absent from the External Dogs page.
- Helper Usage:
ExternalDogs.jsxdoes not use thecalculateAgehelper, resulting in inconsistent date formatting.
Affected Components
client/src/pages/ExternalDogs.jsx
Proposed Solution
Refactor ExternalDogs.jsx to mirror the structure and style of DogList.jsx:
- Standardize Imports: Use
axiosinstead offetch. ImportChampionBadge,ChampionBloodlineBadge, and necessarylucide-reacticons. - Match Layout: Update the main container and header to match
DogList.jsxusing thecontainerclass and consistent inline styles. - Sync Filter Bar: Use the same search and filter bar implementation as
DogList.jsx. - Implement List View: Replace the
dog-gridwith a vertical stack of cards matching the Dogs page style. - Add Delete Functionality: Implement the
handleDeletelogic and add theDelete Confirmation Modal. - Use Badges & Helpers: Replace emoji badges with the standardized badge components and use
calculateAgefor birth dates. - Consistent Navigation: Use
react-router-dom'sLinkfor navigation to dog details.