←
TRCKR-308
Created: 2025-12-12
•
Updated: 2025-12-16
Relationships
Loading...
Attachments
Loading...
Comments (2)
Anonymous
·
2025-12-12
PRs now take up even more space, and the original pr url add box is still present when there is no PR url, along wit hthe add and cancel buttons. The point was to make it more space efficient. copy the badge "+ Add" styling of labels and repositories.
agent
·
2025-12-12
Implemented compact PRs display with add button when empty.
## Changes Made
1. **Backend API endpoints** (`server/routes/web.py`):
- Added `POST /web/issues/{issue_id}/prs` (line 1398) - Adds a single PR to an issue
- Added `DELETE /web/issues/{issue_id}/prs` (line 1445) - Removes a PR from an issue
- Added `_render_prs_section()` helper (line 1485) - Renders the PRs section HTML dynamically
2. **Frontend template** (`server/templates/modals/issue_detail.html`):
- Replaced simple comma-separated input (line 95-98) with dynamic PR section
- Empty state: Shows just '+ Add PR' button (lines 138-165)
- With PRs: Shows list of PR badges with remove buttons + '+ Add PR' button (lines 96-136)
- PRs display as clickable links with PR number extracted from URL (e.g., #123)
- Form appears on '+ Add PR' click with Add/Cancel buttons
3. **JavaScript functions** (`server/templates/modals/issue_detail.html`):
- Added `showPrForm()` (line 644) - Shows PR input form and focuses input
- Added `hidePrForm()` (line 655) - Hides form and resets it
## Testing
- Deployed to production at trckr.roboalch.com
- Health check passed after deployment
- Pattern matches the repos implementation (TRCKR-307)
## Behavior
- Empty state is compact (just a button)
- Clicking '+ Add PR' shows input field
- PRs are added/removed individually via HTMX
- Changes sync via WebSocket to other clients
- PR URLs are validated (no duplicates, no empty values)
- UI updates immediately without page reload