recognition: recognition.js showBanner/handleSaveResponse; wired into sky SAVE handler on applet & sky page — TDD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-22 03:05:35 -04:00
parent 3cc9f5a527
commit 565f727aa6
7 changed files with 344 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
{% load static %}
<script src="{% static 'apps/dashboard/recognition.js' %}"></script>
<section
id="id_applet_my_sky"
data-preview-url="{% url 'sky_preview' %}"
@@ -327,10 +328,11 @@
if (!r.ok) throw new Error(`HTTP ${r.status}`);
return r.json();
})
.then(() => {
.then(data => {
formWrap.style.display = 'none';
svgEl.style.display = '';
NatusWheel.preload().then(() => NatusWheel.draw(svgEl, _lastChartData));
Recognition.handleSaveResponse(data);
})
.catch(err => {
setStatus(`Save failed: ${err.message}`, 'error');

View File

@@ -93,6 +93,7 @@
<script src="{% static 'apps/gameboard/d3.min.js' %}"></script>
<script src="{% static 'apps/gameboard/natus-wheel.js' %}"></script>
<script src="{% static 'apps/dashboard/recognition.js' %}"></script>
<script>
(function () {
'use strict';
@@ -299,7 +300,7 @@
if (!r.ok) throw new Error(`HTTP ${r.status}`);
return r.json();
})
.then(() => setStatus('Sky saved!'))
.then(data => { setStatus('Sky saved!'); Recognition.handleSaveResponse(data); })
.catch(err => {
setStatus(`Save failed: ${err.message}`, 'error');
confirmBtn.disabled = false;