?
TRCKR-400
feature backend
Created: 2025-12-17 Updated: 2025-12-17
Relationships Loading...
Attachments
Loading...
Comments (8)
qa-agent · 2025-12-17
## QA PASSED See QA report document: cbbc55f4-cd0d-48dd-97b6-7a4377c41193 **All tests passed:** **Toggle OFF (Default)** - Modal closes after submit: PASS - Toast notification appears: PASS - Table refreshes with new issue: PASS **Toggle ON (Create More)** - Modal stays open: PASS - Title field clears: PASS - Description field clears: PASS - Title input receives focus: PASS - Toast notification appears: PASS - Repeat workflow (second issue): PASS **No console errors detected. No regressions found.** The HX-Trigger header implementation works correctly. Fix verified working.
agent · 2025-12-17
Fixed 'create more' parameter handling using HX-Trigger header approach. **Problem Found:** Previous attempts tried to return a `<script>` tag with `HX-Reswap: none` header. However, when HTMX sees `HX-Reswap: none`, it skips the swap operation **entirely** - the response content is never added to the DOM, so the script never executes. **Solution:** Use `HX-Trigger` header instead of inline scripts. HTMX still fires custom events from HX-Trigger headers even when HX-Reswap is set to 'none'. **Changes Made:** 1. **server/routes/web.py** (lines 672-693): - Added `json` import at top of file - When `create_more == 'on'`, return empty content with headers: - `HX-Reswap: none` - prevents HTMX from swapping the modal - `HX-Trigger` - JSON object with `issueCreated` event containing: - `identifier`: the new issue's identifier - `clearForm`: true (signals to clear title/description) - `projectId`: the selected project ID 2. **server/templates/base.html** (lines 3855-3890): - Added `issueCreated` event listener that: - Stores/clears lastCreatedProjectId in localStorage - Clears title and description input fields - Focuses title input for next entry - Triggers issues table refresh - Shows success toast with identifier 3. **tests/test_server.py** (lines 1701-1728): - Updated `test_create_issue_with_create_more_keeps_modal_open` to verify: - `HX-Reswap: none` header is present - `HX-Trigger` header contains valid JSON with `issueCreated` event - `clearForm` is true and `identifier` is present - Response body is empty **Verification:** All 101 server tests pass including the 3 TestWebIssueCreate tests.
qa-agent · 2025-12-17
## QA FAILED (Third Test - Post HTMX Fix) See QA report document: efbe4f7d-a4b9-4936-aa9a-910651d750f7 **Critical Bug Found:** The JavaScript in the server response is NOT being executed. **Root Cause:** The server returns a `<script>` tag with `HX-Reswap: none` header. However, when HTMX sees `HX-Reswap: none`, it skips the swap operation **entirely** - it does not insert the response content into the DOM. Since the `<script>` tag is never added to the DOM, it never executes. **Evidence:** - Modal stays open (because HTMX doesn't swap it out) - PASS - Table refreshes (via WebSocket broadcast) - PASS - Title NOT cleared - FAIL - Description NOT cleared - FAIL - Toast NOT shown - FAIL - Focus NOT set - FAIL **Recommended Fix:** Use `HX-Trigger` header instead of inline scripts: ```python return HTMLResponse( content='', status_code=200, headers={ 'HX-Reswap': 'none', 'HX-Trigger': json.dumps({ 'issueCreated': {'identifier': identifier, 'clearForm': True} }) }, ) ``` Then add an event listener in the frontend to handle `issueCreated` event. Returning to todo for fixes.
agent · 2025-12-17
Fixed the 'create more' HTMX swap issue by adding HX-Reswap header. **Problem Found:** The server returned a `<script>` tag when `create_more=on`, but HTMX uses `hx-swap="outerHTML"` on the form (which targets `#issue-modal`). This caused HTMX to replace the entire modal with just the script tag, destroying the DOM before the JavaScript could execute. **Changes Made:** - server/routes/web.py line 687: Added `headers={"HX-Reswap": "none"}` to the HTMLResponse when `create_more == "on"` - tests/test_server.py line 1716: Added assertion to verify the `hx-reswap: none` header is present **How It Works:** The `HX-Reswap: none` response header tells HTMX to skip the swap operation entirely. The response content (the script tag) is still processed by the browser, but HTMX does not modify the DOM. This keeps the modal intact while the JavaScript clears the form fields and shows the success toast. **Verification:** - All 101 server tests pass - The test now explicitly verifies the HX-Reswap header is set to "none"
qa-agent · 2025-12-17
## QA FAILED (Re-test) See QA report document: 55283722-c3d0-4715-8810-7d1d1082d930 **Critical Bug Found:** The modal is destroyed by HTMX before the JavaScript can clear the fields. **Root Cause:** The server returns just a \`<script>\` tag when \`create_more=on\`, but HTMX uses \`hx-swap=outerHTML\` which replaces the entire modal with the script tag. By the time the script runs, the modal (and its input fields) no longer exist. **Evidence:** - POST request contains create_more=on (verified) - Server responds with correct script (verified) - After HTMX swap: document.querySelector('#issue-modal') returns null - Modal disappears instead of staying open with cleared fields **Fix Required:** Cannot return just a script tag with hx-swap=outerHTML. Need to either: 1. Return full modal HTML with cleared fields, or 2. Use HX-Reswap: none header + HX-Trigger header for events, or 3. Change form's hx-swap strategy Returning to todo for fixes.
agent · 2025-12-17
Fixed the JavaScript selector issue in POST /web/issues handler. **Problem Found:** Lines 678-680 in server/routes/web.py used getElementById('issue-title') and getElementById('issue-description') to clear form fields after 'Create more' submission, but the form template uses class selectors (.issue-title-input, .issue-description-input), not IDs. **Changes Made:** - server/routes/web.py lines 678-680: Changed from getElementById to querySelector with class selectors - document.getElementById('issue-title') -> document.querySelector('.issue-title-input') - document.getElementById('issue-description') -> document.querySelector('.issue-description-input') **Verification:** - All 101 server tests pass including TestWebIssueCreate tests - The JavaScript now correctly targets the form inputs for clearing
qa-agent · 2025-12-17
## QA FAILED See QA report document: 8c935d61-c6d0-43d8-ab45-d28e4fe11802 **Critical Bug Found:** The form fields are NOT being cleared after issue creation with 'Create more' enabled. **Root Cause:** The JavaScript in server/routes/web.py uses getElementById('issue-title') and getElementById('issue-description'), but these IDs don't exist in the form template. The form uses classes (.issue-title-input, .issue-description-input), not IDs. **Fix Required:** Change lines 692-694 to use class selectors. Returning to todo for fixes.
agent · 2025-12-17
Implemented 'create more' parameter handling in POST /web/issues endpoint. **Changes made:** 1. server/routes/web.py (lines 601-691): - Added create_more: Optional[str] = Form(None) parameter to create_issue_web() function - When create_more == 'on' (checkbox checked): Returns JS that clears title/description fields, focuses title input, refreshes table, and shows toast - but does NOT close modal - When create_more is not set or has other value: Existing behavior (close modal, refresh, toast) 2. tests/test_server.py (lines 1683-1740): - Added TestWebIssueCreate class with 3 tests: - test_create_issue_closes_modal - verifies default behavior closes modal - test_create_issue_with_create_more_keeps_modal_open - verifies create_more=on keeps modal open - test_create_issue_without_create_more_closes_modal - verifies explicit no create_more closes modal **Test results:** All 101 tests pass. **Note:** The frontend toggle (added in TRCKR-399) sends create_more=on when checked. Property dropdowns (status, priority, project, etc.) retain their values since only title and description are cleared.