Spaces:
Sleeping
Sleeping
Commit ·
dbd59f3
1
Parent(s): a88c856
Portrait layout, clean background, richer Recurring Themes
Browse files- Portrait: text justified full-width, keyword tags in a row below (not side-by-side)
- index.css: remove dot-grid overlay so panel background is clean dark (not grey)
- main.py: normalize coaching area synonyms (Active Listening → Listening, etc.)
and capture the latest suggestion text per area
- ProfileView: Recurring Themes shows "{N} of {total} sessions" count + tip text
so each card explains what to work on, not just a label with a flagged count
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- backend/main.py +39 -3
- frontend/src/components/ProfileView.jsx +36 -32
- frontend/src/index.css +0 -2
backend/main.py
CHANGED
|
@@ -1397,10 +1397,46 @@ def get_profile(user_id: str = Depends(get_current_user)):
|
|
| 1397 |
|
| 1398 |
# Recurring coaching areas
|
| 1399 |
from collections import Counter as _Counter
|
| 1400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1401 |
for p in parsed:
|
| 1402 |
-
|
| 1403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1404 |
|
| 1405 |
# Personality synthesis
|
| 1406 |
_dim_paths = {
|
|
|
|
| 1397 |
|
| 1398 |
# Recurring coaching areas
|
| 1399 |
from collections import Counter as _Counter
|
| 1400 |
+
|
| 1401 |
+
def _normalize_area(area: str) -> str:
|
| 1402 |
+
a = area.lower().strip()
|
| 1403 |
+
_SYNONYMS = {
|
| 1404 |
+
"active listening": "listening",
|
| 1405 |
+
"deep listening": "listening",
|
| 1406 |
+
"listen more": "listening",
|
| 1407 |
+
"talk ratio": "talk balance",
|
| 1408 |
+
"talk ratio balance": "talk balance",
|
| 1409 |
+
"giving space": "talk balance",
|
| 1410 |
+
"space for others": "talk balance",
|
| 1411 |
+
"question quality": "asking questions",
|
| 1412 |
+
"question asking": "asking questions",
|
| 1413 |
+
"probing questions": "asking questions",
|
| 1414 |
+
"follow-up questions": "asking questions",
|
| 1415 |
+
"self awareness": "self-awareness",
|
| 1416 |
+
"self-reflection": "self-awareness",
|
| 1417 |
+
"self reflection": "self-awareness",
|
| 1418 |
+
}
|
| 1419 |
+
return _SYNONYMS.get(a, a)
|
| 1420 |
+
|
| 1421 |
+
coaching_map: dict = {}
|
| 1422 |
for p in parsed:
|
| 1423 |
+
for c in p["ins"].get("coaching_suggestions", [])[:2]:
|
| 1424 |
+
area = c.get("area", "")
|
| 1425 |
+
if not area:
|
| 1426 |
+
continue
|
| 1427 |
+
key = _normalize_area(area)
|
| 1428 |
+
coaching_map.setdefault(key, []).append(c.get("suggestion", ""))
|
| 1429 |
+
|
| 1430 |
+
coaching_counter = _Counter({k: len(v) for k, v in coaching_map.items()})
|
| 1431 |
+
recurring_coaching = [
|
| 1432 |
+
{
|
| 1433 |
+
"area": a.title(),
|
| 1434 |
+
"count": c,
|
| 1435 |
+
"tip": coaching_map[a][-1] if coaching_map.get(a) else "",
|
| 1436 |
+
}
|
| 1437 |
+
for a, c in coaching_counter.most_common(3)
|
| 1438 |
+
if c >= 2
|
| 1439 |
+
]
|
| 1440 |
|
| 1441 |
# Personality synthesis
|
| 1442 |
_dim_paths = {
|
frontend/src/components/ProfileView.jsx
CHANGED
|
@@ -618,27 +618,25 @@ export default function ProfileView({ active, onUpload }) {
|
|
| 618 |
borderLeft: "3px solid rgba(59,130,246,0.65)",
|
| 619 |
paddingLeft: 16, marginTop: 10,
|
| 620 |
}}>
|
| 621 |
-
<
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
{
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
}
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
)}
|
| 641 |
-
</div>
|
| 642 |
</div>
|
| 643 |
</div>
|
| 644 |
</Reveal>
|
|
@@ -675,20 +673,26 @@ export default function ProfileView({ active, onUpload }) {
|
|
| 675 |
const accent = ["#f87171", "#fb923c", "#818cf8"][i] || "#8b89aa"
|
| 676 |
return (
|
| 677 |
<div key={item.area} style={{
|
| 678 |
-
|
| 679 |
-
padding: "12px 16px", borderRadius: 10,
|
| 680 |
background: "#151922", border: `1px solid #1e2438`,
|
| 681 |
borderLeft: `3px solid ${accent}`,
|
| 682 |
}}>
|
| 683 |
-
<
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 692 |
</div>
|
| 693 |
)
|
| 694 |
})}
|
|
|
|
| 618 |
borderLeft: "3px solid rgba(59,130,246,0.65)",
|
| 619 |
paddingLeft: 16, marginTop: 10,
|
| 620 |
}}>
|
| 621 |
+
<p style={{ fontSize: 14, color: "#c4c2d8",
|
| 622 |
+
lineHeight: 1.9, margin: 0, textAlign: "justify" }}>
|
| 623 |
+
{personality.paragraph}
|
| 624 |
+
</p>
|
| 625 |
+
{keywords.length > 0 && (
|
| 626 |
+
<div style={{ display: "flex", flexWrap: "wrap", gap: 6, marginTop: 12 }}>
|
| 627 |
+
{keywords.map((kw, i) => (
|
| 628 |
+
<span key={i} style={{
|
| 629 |
+
fontSize: 12, fontWeight: 600, padding: "5px 14px",
|
| 630 |
+
borderRadius: 6, letterSpacing: 0.2,
|
| 631 |
+
background: "linear-gradient(#151922, #151922) padding-box, linear-gradient(135deg, rgba(59,130,246,0.5), rgba(34,211,238,0.5)) border-box",
|
| 632 |
+
border: "1px solid transparent",
|
| 633 |
+
color: "#60a5fa", whiteSpace: "nowrap",
|
| 634 |
+
}}>
|
| 635 |
+
{kw}
|
| 636 |
+
</span>
|
| 637 |
+
))}
|
| 638 |
+
</div>
|
| 639 |
+
)}
|
|
|
|
|
|
|
| 640 |
</div>
|
| 641 |
</div>
|
| 642 |
</Reveal>
|
|
|
|
| 673 |
const accent = ["#f87171", "#fb923c", "#818cf8"][i] || "#8b89aa"
|
| 674 |
return (
|
| 675 |
<div key={item.area} style={{
|
| 676 |
+
padding: "14px 16px", borderRadius: 10,
|
|
|
|
| 677 |
background: "#151922", border: `1px solid #1e2438`,
|
| 678 |
borderLeft: `3px solid ${accent}`,
|
| 679 |
}}>
|
| 680 |
+
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: item.tip ? 8 : 0 }}>
|
| 681 |
+
<span style={{ fontSize: 13, fontWeight: 700, color: "#f0eeff",
|
| 682 |
+
textTransform: "capitalize" }}>
|
| 683 |
+
{item.area}
|
| 684 |
+
</span>
|
| 685 |
+
<span style={{ fontSize: 11, color: accent, fontWeight: 600,
|
| 686 |
+
background: `${accent}15`, border: `1px solid ${accent}30`,
|
| 687 |
+
borderRadius: 20, padding: "3px 10px", whiteSpace: "nowrap", marginLeft: 12 }}>
|
| 688 |
+
{item.count} of {session_count} sessions
|
| 689 |
+
</span>
|
| 690 |
+
</div>
|
| 691 |
+
{item.tip && (
|
| 692 |
+
<p style={{ margin: 0, fontSize: 12, color: "#8b89aa", lineHeight: 1.65 }}>
|
| 693 |
+
{item.tip}
|
| 694 |
+
</p>
|
| 695 |
+
)}
|
| 696 |
</div>
|
| 697 |
)
|
| 698 |
})}
|
frontend/src/index.css
CHANGED
|
@@ -7,8 +7,6 @@
|
|
| 7 |
body {
|
| 8 |
width: 100%;
|
| 9 |
background: #0f1117;
|
| 10 |
-
background-image: radial-gradient(rgba(255,255,255,0.028) 1px, transparent 1px);
|
| 11 |
-
background-size: 28px 28px;
|
| 12 |
color: #f0eeff;
|
| 13 |
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
| 14 |
-webkit-font-smoothing: antialiased;
|
|
|
|
| 7 |
body {
|
| 8 |
width: 100%;
|
| 9 |
background: #0f1117;
|
|
|
|
|
|
|
| 10 |
color: #f0eeff;
|
| 11 |
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
| 12 |
-webkit-font-smoothing: antialiased;
|