V145 V146 wiki - admin sessions_sources KPI backend + render card
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
Some checks failed
WEVAL NonReg / nonreg (push) Has been cancelled
V145 backend:
c_wevia helper COUNT wevia_db
sessions_sources channel with 9 metrics:
widget, wevia_master, chatbot_api, form_inline, bots, legacy_null,
total, today, last_7d
V146 render:
order extended with sessions_sources
render branch 3 colored sub-cards
emerald widget orange master pink forms
tooltip titles
Admin dashboard UX: 6 cards now (added sessions_sources)
Yacine sees real-time breakdown at glance without opening Sessions tab
GOLD backups:
wevia-admin.php.GOLD-V145-20260422-010154
wevia-admin.php.GOLD-V146-20260422-010243
chattr unlock/edit/relock 2x
L99 153/153 PASS (16 consecutive versions V125-V146)
Chain V131-V146 complete:
V131 routing,
V132 Playwright,
V133-V134 4/4 hubs,
V135-V136 admin repoint,
V137-V138 logging,
V139 filter+chatbot,
V140 defense,
V141 handoff,
V142 form+audits,
V143 split,
V144 ambre cache,
V145 sessions_sources backend,
V146 sessions_sources render
Doctrines 0+1+2+4+14+16+54+60+95+100
This commit is contained in:
163
wiki/session-V145-V146-sessions-sources-kpi-backend-render.md
Normal file
163
wiki/session-V145-V146-sessions-sources-kpi-backend-render.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# V145 + V146 - Admin sessions_sources KPI card (backend + render) - 2026-04-22
|
||||
|
||||
## Objectif Yacine "GO FINI TOUT SANS T'ARRÊTER"
|
||||
|
||||
Après V144 (session split + ambre-deps cache), ajouter **observabilité
|
||||
real-time** au top panel admin dashboard. Yacine doit voir en un coup
|
||||
d'œil la distribution par source sans ouvrir Sessions tab.
|
||||
|
||||
## V145 — Backend channel sessions_sources ✅
|
||||
|
||||
### Ajout
|
||||
- **Helper c_wevia()** : équivalent c204/c95 pour COUNT sur wevia_db
|
||||
- **Nouveau channel** `sessions_sources` dans `"channels"` array API response
|
||||
|
||||
```php
|
||||
"sessions_sources" => [
|
||||
"label"=>"Sources Sessions",
|
||||
"icon"=>"📊",
|
||||
"color"=>"#34d399",
|
||||
"widget" => c_wevia("SELECT COUNT(*) FROM public.conversations WHERE source='widget'"),
|
||||
"wevia_master" => c_wevia("... WHERE source='wevia-master'"),
|
||||
"chatbot_api" => c_wevia("... WHERE source='wevia-chatbot-api'"),
|
||||
"form_inline" => c_wevia("... WHERE source='form-inline'"),
|
||||
"bots" => c_wevia("... WHERE session_id LIKE 'default-bot-%'"),
|
||||
"legacy_null" => c_wevia("... WHERE source IS NULL"),
|
||||
"total" => c_wevia("SELECT COUNT(*) FROM public.conversations"),
|
||||
"today" => c_wevia("... WHERE created_at::date=CURRENT_DATE"),
|
||||
"last_7d" => c_wevia("... WHERE created_at > NOW() - INTERVAL '7 days'"),
|
||||
],
|
||||
```
|
||||
|
||||
### Valeurs observées (snapshot V145)
|
||||
```json
|
||||
{
|
||||
"widget": 3272,
|
||||
"wevia_master": 23+,
|
||||
"chatbot_api": 0,
|
||||
"form_inline": 3+,
|
||||
"bots": 2481 (default-bot-% 29 buckets),
|
||||
"legacy_null": 607,
|
||||
"total": 6386
|
||||
}
|
||||
```
|
||||
|
||||
### Diff admin.php
|
||||
Size 84463 → 85770 bytes (+1307 bytes pour helper + query channel).
|
||||
|
||||
## V146 — Frontend render card ✅
|
||||
|
||||
### Ajout dans renderChannels()
|
||||
|
||||
**Order array étendu** :
|
||||
```javascript
|
||||
// V145:
|
||||
const order = ['chatbot_site','forms','leads','knowledge','wevia_master'];
|
||||
// V146:
|
||||
const order = ['chatbot_site','forms','leads','knowledge','wevia_master','sessions_sources'];
|
||||
```
|
||||
|
||||
**New render branch** :
|
||||
```javascript
|
||||
else if (k==='sessions_sources') {
|
||||
main = c.total;
|
||||
sub = `${fmt(c.widget||0)} widget · ${fmt(c.bots||0)} bots`;
|
||||
stats = 3 colored sub-cards:
|
||||
🟢 Widget (emerald #34d399)
|
||||
🟠 Master (orange #fb923c)
|
||||
🩷 Forms (pink #f472b6)
|
||||
}
|
||||
```
|
||||
|
||||
Chaque stat sub-card a son propre style.color inline pour visualisation
|
||||
distincte au glance.
|
||||
|
||||
### UX Premium doctrine 60
|
||||
- Icônes emoji contextuels (🟢🟠🩷)
|
||||
- Couleurs cohérentes avec filter dropdown V139-V142
|
||||
- Hover tooltips via `title="..."` attributs
|
||||
- Font weight + colors typographic hierarchy
|
||||
|
||||
### Diff admin.php
|
||||
Size 85770 → 86403 bytes (+633 bytes render).
|
||||
|
||||
## GOLD backups V145-V146
|
||||
|
||||
```
|
||||
/opt/wevads/vault/wevia-admin.php.GOLD-V145-20260422-010154 (pre-V145)
|
||||
/opt/wevads/vault/wevia-admin.php.GOLD-V146-20260422-010243 (pre-V146)
|
||||
```
|
||||
|
||||
## chattr +i doctrine 54 respecté
|
||||
unlock → edit → relock pattern appliqué 2 fois (V145 + V146).
|
||||
|
||||
## Admin dashboard UX final
|
||||
|
||||
Top panel Channels maintenant affiche 6 cards:
|
||||
|
||||
1. 💬 **Chatbot Site** — S95 historique (stale, 63 sessions 22j)
|
||||
2. 📝 **Formulaires** — form_submissions
|
||||
3. 🎯 **Leads Pool** — leads + linkedin + CRM
|
||||
4. 🧠 **Knowledge** — chatbot_kb + memory + claude + hamid
|
||||
5. 🤖 **WEVIA Master** — c204 events
|
||||
6. 📊 **Sources Sessions** (V145-V146 NEW) — wevia_db breakdown live
|
||||
|
||||
**Yacine voit au glance depuis V146** :
|
||||
- Total sessions wevia_db
|
||||
- Widget vs Master vs Forms proportions
|
||||
- Bot traffic volume
|
||||
- Sans cliquer sur Sessions tab
|
||||
|
||||
## Chain V131→V146 complete
|
||||
|
||||
```
|
||||
V131 🎯 Routing 100%
|
||||
V132 🎯 Playwright 12/12
|
||||
V133-V134 🔗 4/4 hubs anti-orphan
|
||||
V135 📊 Diagnostic sessions
|
||||
V136 📊 Admin repoint wevia_db + UI source badges
|
||||
V137 💬 Widget silent-fail fix
|
||||
V138 🔒 Master re-inject + chattr
|
||||
V139 🎨 Filter dropdown + chatbot source + Playwright
|
||||
V140 🔒 Defense-in-depth 3 files chattr
|
||||
V141 📝 Handoff consolidation
|
||||
V142 ✅ Form early-log + admin bot filter + audits
|
||||
V143 🔀 Session default split (2481 → 29 buckets)
|
||||
V144 ⚡ ambre-deps cache (30s → 0.14s x250 faster)
|
||||
V145 📊 Sessions_sources KPI backend
|
||||
V146 🎨 Sessions_sources KPI card render
|
||||
```
|
||||
|
||||
## Commits V144-V146 pushed
|
||||
- `c4bf820a9` V144 wiki + ambre-deps cache
|
||||
- `8accf302f` V145 sessions_sources backend
|
||||
- `ae753cc73` V146 sessions_sources render
|
||||
|
||||
## L99 zero régression
|
||||
**153/153 PASS sur 16 versions consécutives V125-V146** 🎯
|
||||
|
||||
## Doctrines V145-V146
|
||||
|
||||
- 0 Root cause (observabilité manquante au panel)
|
||||
- 1 GOLD backup (2 backups V145 + V146)
|
||||
- 2 Zero écrasement (nouveau channel, no touch existants)
|
||||
- 4 Zero régression L99 stable
|
||||
- 14 Test-driven (lint + HTTP 200 admin verify)
|
||||
- 16 Pattern cohérent avec 5 autres channels
|
||||
- 54 chattr unlock/relock
|
||||
- 60 UX premium (emoji + colored sub-stats + tooltips)
|
||||
- 95 Traçabilité wiki + vault
|
||||
- 100 Train release
|
||||
|
||||
## Environnement final session V131-V146
|
||||
|
||||
- **L99** : 153/153 PASS ✅ (16 versions)
|
||||
- **4 sources** sessions actives + bot buckets disambiguated
|
||||
- **chattr +i** 5 files défense contre auto-sync
|
||||
- **1259+ GOLDs** préservés
|
||||
- **1.4MB DB backup** conv-default
|
||||
- **ambre-deps** x250 faster
|
||||
- **Admin KPI panel** enrichi sessions_sources live
|
||||
- **42+ wikis** V131-V146 publiés
|
||||
|
||||
Mission complète GODMODE. Repos mérité. 🌙
|
||||
Reference in New Issue
Block a user