codyssey-seungmin commited on
Commit
f613cea
·
1 Parent(s): 9393143

Label AI-generated coach responses

Browse files
Files changed (4) hide show
  1. dist/app.js +7 -1
  2. dist/index.html +1 -0
  3. dist/styles.css +2 -2
  4. dist/sw.js +1 -1
dist/app.js CHANGED
@@ -181,7 +181,8 @@ async function analyzeDiary(text, stress) {
181
  const analysis = data.analysis;
182
  return {id: crypto.randomUUID(), ranked: analysis.labels.map(x => ({name:x.name, score:x.score})),
183
  model: analysis.model, revision: analysis.revision, chunks: analysis.chunks,
184
- agentMessage: data.message, recommendation: data.recommendation, comfort: data.comfort,
 
185
  stress, text, tags: [...selectedTags], date: new Date().toISOString(),
186
  detailedMood: null, confirmedMood: null};
187
  }
@@ -285,6 +286,11 @@ function renderAnalysis() {
285
  };
286
  document.getElementById('analysis-message').textContent = lastAnalysis.agentMessage || messages[lead];
287
  renderComfort(lastAnalysis.comfort);
 
 
 
 
 
288
  updateMoodUI();
289
  updateRecordUI(lastAnalysis);
290
  }
 
181
  const analysis = data.analysis;
182
  return {id: crypto.randomUUID(), ranked: analysis.labels.map(x => ({name:x.name, score:x.score})),
183
  model: analysis.model, revision: analysis.revision, chunks: analysis.chunks,
184
+ agentMessage: data.message, responseType: data.response_type,
185
+ recommendation: data.recommendation, comfort: data.comfort,
186
  stress, text, tags: [...selectedTags], date: new Date().toISOString(),
187
  detailedMood: null, confirmedMood: null};
188
  }
 
286
  };
287
  document.getElementById('analysis-message').textContent = lastAnalysis.agentMessage || messages[lead];
288
  renderComfort(lastAnalysis.comfort);
289
+ const generationNote = document.getElementById('coach-generation-note');
290
+ generationNote.hidden = false;
291
+ generationNote.textContent = lastAnalysis.responseType === 'llm_grounded'
292
+ ? 'AI가 출처를 바탕으로 생성한 문장이며 의료적 진단이 아니에요.'
293
+ : '연결 상태에 따라 규칙 기반 문장으로 제공됐어요.';
294
  updateMoodUI();
295
  updateRecordUI(lastAnalysis);
296
  }
dist/index.html CHANGED
@@ -138,6 +138,7 @@
138
  <div class="coach-avatar" aria-hidden="true">☁</div>
139
  <div><span class="eyebrow">마음을 위한 한마디</span><p id="analysis-message"></p>
140
  <div class="quote-block" id="comfort-quote" hidden></div>
 
141
  </div>
142
  </div>
143
 
 
138
  <div class="coach-avatar" aria-hidden="true">☁</div>
139
  <div><span class="eyebrow">마음을 위한 한마디</span><p id="analysis-message"></p>
140
  <div class="quote-block" id="comfort-quote" hidden></div>
141
+ <small class="model-note coach-generation-note" id="coach-generation-note" hidden></small>
142
  </div>
143
  </div>
144
 
dist/styles.css CHANGED
@@ -115,7 +115,7 @@ p { color: var(--muted); line-height: 1.62; font-size: 15px; }
115
  .privacy-inline { font-size: 12px; text-align: center; margin: 24px 0 10px; word-break: keep-all; overflow-wrap: break-word; }.submit-button { margin-bottom: 8px; }
116
 
117
  .analysis-card { padding: 20px; }.card-label { font-weight: 700; font-size: 13px; margin-bottom: 12px; }.emotion-result { background: #f8f7f4; border-radius: 18px; padding: 6px 4px 2px; }.emo-radar { display: block; width: 100%; height: auto; }.emo-grid { fill: none; stroke: rgba(66,78,113,.13); stroke-width: 1; }.emo-spoke { stroke: rgba(66,78,113,.10); stroke-width: 1; }.emo-shape { fill: rgba(82,111,207,.16); stroke: var(--blue-deep); stroke-width: 2; stroke-linejoin: round; }.emo-dot { fill: #fff; stroke: var(--blue-deep); stroke-width: 2; }.emo-dot.lead { fill: var(--blue-deep); stroke: #fff; }.emo-label { font-size: 11.5px; fill: var(--muted); font-weight: 600; }.emo-label.lead { fill: var(--ink); font-weight: 800; }.emo-score { font-size: 9.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }.emo-score.lead { fill: var(--blue-deep); font-weight: 700; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }.divider { height: 1px; background: var(--line); margin: 18px 0; }.analysis-summary { color: var(--ink); font-weight: 600; margin-bottom: 8px; }.meter { height: 9px; background: #eeeaf0; border-radius: 999px; overflow: hidden; }.meter span { display: block; height: 100%; width: 60%; border-radius: inherit; background: linear-gradient(90deg, #ff9178, #ffc2a1); transition: width .7s ease; }.model-note { color: var(--muted); display: block; margin-top: 9px; font-size: 10px; }
118
- .coach-note { padding: 17px; display: flex; gap: 13px; margin-top: 12px; background: linear-gradient(135deg, #eef5ff, #f3efff); }.coach-note p { margin: 5px 0 0; font-size: 13px; }
119
  .mood-confirm { width: 100%; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; text-align: left; color: inherit; cursor: pointer; }.mood-dot { width: 42px; height: 42px; border-radius: 50%; background: #ec846f; }.mood-confirm strong, .mood-confirm small { display: block; }.mood-confirm small { color: var(--muted); margin-top: 3px; }.mood-confirm + .primary-button { margin-top: 16px; }
120
 
121
  .recommend-list { display: grid; gap: 12px; }.recommend-list > .model-note { padding-left: 12px; font-size: 12px; line-height: 1.6; }.recommendation { padding: 17px; display: grid; grid-template-columns: 56px 1fr; gap: 13px; }.recommendation.featured { background: linear-gradient(135deg, #fbfefa, #edf7ef); border-color: rgba(100,158,118,.18); }.rec-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 25px; }.rec-icon.mint { background: var(--mint); }.rec-icon.blue { background: var(--sky); }.rec-icon.lilac { background: var(--lilac); }.recommendation h3 { margin: 5px 0 5px; }.recommendation p { font-size: 13px; margin-bottom: 12px; }.recommendation .secondary-button { grid-column: 2; min-height: 42px; }.pale-blue { background: #d8e9ff; color: #42679e; }.pale-lilac { background: #e9e3f9; color: #67548f; }.gentle-note { margin: 20px 0 0; background: linear-gradient(135deg, #fff2e9, #fbf1ea); padding: 18px; border-radius: 22px; text-align: center; color: #8b6f66; }
@@ -175,7 +175,7 @@ dialog { border: 0; padding: 0; color: var(--ink); }.sheet-dialog { width: min(4
175
  }
176
 
177
 
178
- .quote-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(66,78,113,.18); }.quote-text { margin: 0 0 6px; font-size: 13.5px; line-height: 1.65; font-style: italic; color: var(--ink); }.quote-by { display: block; font-size: 11px; color: var(--muted); font-style: normal; }.quote-by a { color: var(--muted); }.quote-license { display: block; font-size: 9.5px; color: var(--muted); opacity: .8; margin-top: 2px; }.care-card { padding: 20px; }.care-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; margin-bottom: 12px; }.care-row:last-of-type { margin-bottom: 4px; }.care-icon { font-size: 22px; line-height: 1.2; }.care-row strong { display: block; font-size: 14px; }.care-meaning { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }.care-row p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
179
 
180
  .heal-guide { margin: 0 0 8px; padding-left: 12px; font-size: 12px; color: var(--muted); }.heal-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 12px; }.heal-tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; text-align: left; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; cursor: pointer; transition: border-color .15s, background .15s; }.heal-tab small { font-size: 10.5px; font-weight: 500; color: var(--muted); }.heal-tab:hover { border-color: var(--blue); }.heal-tab.active { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }.heal-tab.active small { color: rgba(255,255,255,.75); }.heal-detail { padding: 20px; }.heal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }.heal-min { font-size: 11px; color: var(--muted); }.heal-detail h3 { margin: 0 0 6px; font-size: 17px; }.heal-desc { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.65; }.heal-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }.heal-steps li { font-size: 13px; line-height: 1.6; }.heal-steps li::marker { color: var(--blue-deep); font-weight: 700; }.heal-detail .secondary-button.playing { background: var(--blue-deep); color: #fff; }
181
  .heal-copying-quote { margin: 0 0 14px; }.heal-copying-quote .eyebrow { display: block; margin-bottom: 7px; }.heal-copying-quote .model-note { margin: 5px 0 0; }
 
115
  .privacy-inline { font-size: 12px; text-align: center; margin: 24px 0 10px; word-break: keep-all; overflow-wrap: break-word; }.submit-button { margin-bottom: 8px; }
116
 
117
  .analysis-card { padding: 20px; }.card-label { font-weight: 700; font-size: 13px; margin-bottom: 12px; }.emotion-result { background: #f8f7f4; border-radius: 18px; padding: 6px 4px 2px; }.emo-radar { display: block; width: 100%; height: auto; }.emo-grid { fill: none; stroke: rgba(66,78,113,.13); stroke-width: 1; }.emo-spoke { stroke: rgba(66,78,113,.10); stroke-width: 1; }.emo-shape { fill: rgba(82,111,207,.16); stroke: var(--blue-deep); stroke-width: 2; stroke-linejoin: round; }.emo-dot { fill: #fff; stroke: var(--blue-deep); stroke-width: 2; }.emo-dot.lead { fill: var(--blue-deep); stroke: #fff; }.emo-label { font-size: 11.5px; fill: var(--muted); font-weight: 600; }.emo-label.lead { fill: var(--ink); font-weight: 800; }.emo-score { font-size: 9.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }.emo-score.lead { fill: var(--blue-deep); font-weight: 700; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }.divider { height: 1px; background: var(--line); margin: 18px 0; }.analysis-summary { color: var(--ink); font-weight: 600; margin-bottom: 8px; }.meter { height: 9px; background: #eeeaf0; border-radius: 999px; overflow: hidden; }.meter span { display: block; height: 100%; width: 60%; border-radius: inherit; background: linear-gradient(90deg, #ff9178, #ffc2a1); transition: width .7s ease; }.model-note { color: var(--muted); display: block; margin-top: 9px; font-size: 10px; }
118
+ .coach-note { padding: 17px; display: flex; gap: 13px; margin-top: 12px; background: linear-gradient(135deg, #eef5ff, #f3efff); }.coach-note p { margin: 5px 0 0; font-size: 13px; }.coach-generation-note { margin-top: 12px; line-height: 1.55; word-break: keep-all; overflow-wrap: break-word; }
119
  .mood-confirm { width: 100%; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; text-align: left; color: inherit; cursor: pointer; }.mood-dot { width: 42px; height: 42px; border-radius: 50%; background: #ec846f; }.mood-confirm strong, .mood-confirm small { display: block; }.mood-confirm small { color: var(--muted); margin-top: 3px; }.mood-confirm + .primary-button { margin-top: 16px; }
120
 
121
  .recommend-list { display: grid; gap: 12px; }.recommend-list > .model-note { padding-left: 12px; font-size: 12px; line-height: 1.6; }.recommendation { padding: 17px; display: grid; grid-template-columns: 56px 1fr; gap: 13px; }.recommendation.featured { background: linear-gradient(135deg, #fbfefa, #edf7ef); border-color: rgba(100,158,118,.18); }.rec-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 25px; }.rec-icon.mint { background: var(--mint); }.rec-icon.blue { background: var(--sky); }.rec-icon.lilac { background: var(--lilac); }.recommendation h3 { margin: 5px 0 5px; }.recommendation p { font-size: 13px; margin-bottom: 12px; }.recommendation .secondary-button { grid-column: 2; min-height: 42px; }.pale-blue { background: #d8e9ff; color: #42679e; }.pale-lilac { background: #e9e3f9; color: #67548f; }.gentle-note { margin: 20px 0 0; background: linear-gradient(135deg, #fff2e9, #fbf1ea); padding: 18px; border-radius: 22px; text-align: center; color: #8b6f66; }
 
175
  }
176
 
177
 
178
+ .quote-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(66,78,113,.18); }.quote-text { margin: 0 0 6px; font-size: 13.5px; line-height: 1.65; font-style: italic; color: var(--ink); }.quote-by { display: block; font-size: 11px; color: var(--muted); font-style: normal; }.quote-by a { color: var(--muted); }.quote-license { display: block; font-size: 9.5px; color: var(--muted); opacity: .8; margin-top: 2px; }.care-card { margin-top: 14px; padding: 20px; }.care-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; margin-bottom: 12px; }.care-row:last-of-type { margin-bottom: 4px; }.care-icon { font-size: 22px; line-height: 1.2; }.care-row strong { display: block; font-size: 14px; }.care-meaning { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }.care-row p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
179
 
180
  .heal-guide { margin: 0 0 8px; padding-left: 12px; font-size: 12px; color: var(--muted); }.heal-tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 12px; }.heal-tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 14px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; text-align: left; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; cursor: pointer; transition: border-color .15s, background .15s; }.heal-tab small { font-size: 10.5px; font-weight: 500; color: var(--muted); }.heal-tab:hover { border-color: var(--blue); }.heal-tab.active { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }.heal-tab.active small { color: rgba(255,255,255,.75); }.heal-detail { padding: 20px; }.heal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }.heal-min { font-size: 11px; color: var(--muted); }.heal-detail h3 { margin: 0 0 6px; font-size: 17px; }.heal-desc { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.65; }.heal-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }.heal-steps li { font-size: 13px; line-height: 1.6; }.heal-steps li::marker { color: var(--blue-deep); font-weight: 700; }.heal-detail .secondary-button.playing { background: var(--blue-deep); color: #fff; }
181
  .heal-copying-quote { margin: 0 0 14px; }.heal-copying-quote .eyebrow { display: block; margin-bottom: 7px; }.heal-copying-quote .model-note { margin: 5px 0 0; }
dist/sw.js CHANGED
@@ -5,7 +5,7 @@
5
  * - 캐시에는 화면 자원(HTML·CSS·JS·아이콘)과 빗소리·파도 음원을 담는다.
6
  * - 버전을 올리면 이전 캐시는 즉시 삭제된다.
7
  */
8
- const VERSION = 'mindily-r20261001wordbreak2';
9
  const SHELL = [
10
  './',
11
  'index.html',
 
5
  * - 캐시에는 화면 자원(HTML·CSS·JS·아이콘)과 빗소리·파도 음원을 담는다.
6
  * - 버전을 올리면 이전 캐시는 즉시 삭제된다.
7
  */
8
+ const VERSION = 'mindily-r20261013-ai-disclosure';
9
  const SHELL = [
10
  './',
11
  'index.html',