## Implementation Plan ### 1. Primary Fix – Gist Card Star Vote AJAX Bypass **Problem:** In `devplacepy/templates/gists.html`, the star vote `
` element has `_stop=True`, which causes `DomUtils.initStopPropagation()` to call `e.stopPropagation()` on click. This prevents the click event from reaching `document` where `VoteManager.onClick` listens, so the AJAX optimistic path is skipped. Instead, the form submits natively (full page reload). **Change:** - File: `devplacepy/templates/gists.html` - Locate the `` element that includes the star vote button (currently at approximately line 62). It will have the attribute `_stop` set to `True` (likely `_stop=True` inside a Jinja attribute). - Remove the `_stop=True` attribute entirely from that `` tag. - No other changes to the template are required; the existing markup for `_star_vote.html` inclusion will work correctly without the `_stop` flag, allowing the click to bubble up to `VoteManager`. **Rationale:** This aligns the gist star vote with project star votes and all other vote types that work via AJAX. The `_stop` attribute was the root cause of the deterministic AJAX bypass. ### 2. Secondary Fix – Silent Error Handling Hides Failures **Problem:** In `devplacepy/static/js/OptimisticAction.js` (line 22), the call to `Http.sendForm` passes `{ silent: true }`. When an AJAX vote fails (network error, server-side issue), the error is silently handled: only a small 1.5s toast on the button is shown, which users easily miss. This makes transient failures appear as if the button is unresponsive. **Change:** - File: `devplacepy/static/js/OptimisticAction.js` - Line 22 (approximately): change the options object from `{ silent: true }` to `{ silent: false }`. - This will cause the standard error notification dialog (defined in `Http.notifyError`) to be displayed when a vote request fails, giving the user clear visible feedback instead of a subtle toast. **Note:** It is already verified that this call path is only used for vote actions (via `VoteManager`). The change will not affect other parts of the system. ### 3. Verification & Edge Cases - No other templates or JS files need modification. - Ensure that after the changes, the project’s existing unit tests still pass (with known pre-existing failures ignored). - The linter must report zero new issues on changed files. --- ## Definition of Done - [ ] Remove `_stop=True` from the star vote `` in `devplacepy/templates/gists.html` (exact attribute located by searching for `_stop` in that file; only one instance exists for star votes). - [ ] Change `silent: true` to `silent: false` in the `Http.sendForm` call inside `devplacepy/static/js/OptimisticAction.js`. - [ ] Run `pip install -e '.[dev]' -q && make test-unit` – all tests pass (pre-existing failures unrelated to this change are acceptable). - [ ] Run `pip install -q ruff && ruff check .` – zero lint errors in both modified files. - [ ] Manual check (optional but recommended): After deployment, clicking a gist card star button updates the vote count instantly without a page reload; if a network error occurs, a standard error dialog appears (not only a small button toast).