Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2bdb547
feat(assistant): add AI SDK dependencies and image-free markdown
nicolaskempf57 Nov 5, 2026
d7f5904
feat(charts): fetch 50 sorted groups and warn when a chart has more
nicolaskempf57 Nov 5, 2026
31c170a
fix(charts): ignore stale chart data responses and keep data when the…
nicolaskempf57 Nov 5, 2026
b1169f6
feat(charts): limit the displayed values and restyle the chart
nicolaskempf57 Nov 5, 2026
98441f2
fix(charts): align every series on the first series X values when lim…
nicolaskempf57 Nov 5, 2026
98cc501
feat(assistant): add chat utilities for chart tool results
nicolaskempf57 Nov 5, 2026
1c83da8
fix(assistant): agree the update summary participle in gender and number
nicolaskempf57 Nov 5, 2026
b286328
feat(assistant): add the assistant chat panel
nicolaskempf57 Nov 5, 2026
48cb1b3
feat(charts): apply assistant chart results to the form
nicolaskempf57 Nov 5, 2026
c01ff18
fix(charts): point count series at the x column
nicolaskempf57 Nov 5, 2026
49074eb
test(e2e): serve a scripted assistant chat from the fake services
nicolaskempf57 Nov 5, 2026
47cc4b3
feat(charts): redesign the data studio around the assistant panel
nicolaskempf57 Nov 5, 2026
0265248
feat(charts): apply assistant chart results to the data studio form
nicolaskempf57 Nov 5, 2026
992c20f
fix(charts): keep the Y sorts for a count series
nicolaskempf57 Nov 5, 2026
7abd68f
test(assistant): e2e chart creation and update through a fake assistant
nicolaskempf57 Nov 5, 2026
ada11bd
fix(charts): fetch the preview data per series and only when it changes
nicolaskempf57 Nov 5, 2026
aa57fc0
fix(charts): move every count series to the new X column
nicolaskempf57 Nov 5, 2026
f3ec3b7
fix(assistant): send a trimmed chart and announce new messages
nicolaskempf57 Nov 5, 2026
eeba151
feat(header): add a sysadmin-only chart entry to the publish menu
nicolaskempf57 Nov 5, 2026
985a4da
fix(assistant): authenticate the chat transport like $api
nicolaskempf57 Nov 6, 2026
64b14fa
fix(assistant): drop the failed turn before restoring its text
nicolaskempf57 Nov 6, 2026
5a36f48
feat(assistant): explain a 413 from the chat endpoint
nicolaskempf57 Nov 6, 2026
588706a
fix(components): drop the Listbox wrapper shadow
nicolaskempf57 Nov 9, 2026
cd4e181
refactor(charts): reorder configurator sections like the prototype
nicolaskempf57 Nov 9, 2026
d1f9d07
feat(charts): align the Y axis and styles form with the prototype
nicolaskempf57 Nov 9, 2026
db87cbe
feat(components): steady chart loading, readable series and api-tabul…
nicolaskempf57 Nov 10, 2026
38b2841
feat(assistant): welcome, chart suggestions, new conversation and lig…
nicolaskempf57 Nov 10, 2026
46ac7ba
feat(charts): tabbed configurator with a shared save footer and requi…
nicolaskempf57 Nov 10, 2026
65a50cc
test(charts): route the scripted assistant whatever the query string
nicolaskempf57 Nov 10, 2026
7d6f2b2
fix(components): encode tabular-api filters for its PostgREST backend
nicolaskempf57 Nov 10, 2026
d55ce41
fix(components): detect truncated charts from the total and the profile
nicolaskempf57 Nov 10, 2026
3e5761c
fix(components): one two-layer encoding for tabular-api names and val…
nicolaskempf57 Nov 12, 2026
4a21779
fix(components): accessible chart colors, markers, text alternative a…
nicolaskempf57 Nov 12, 2026
b3926a2
fix(charts,assistant): legends, required explanation, save warning, s…
nicolaskempf57 Nov 12, 2026
18f1cc4
test(e2e): re-record CADA fixtures and route the scripted assistant o…
nicolaskempf57 Nov 12, 2026
e5ae787
fix(components): show chart truncation as an explicit warning below t…
nicolaskempf57 Nov 12, 2026
abab2f8
fix(components): overlay the truncation warning on a dimmed chart and…
nicolaskempf57 Nov 12, 2026
97831f4
fix(charts): restore the DSFR form fields and drop the resource schem…
nicolaskempf57 Nov 12, 2026
f1c72d4
fix(components): capture chart images at the card ratio
nicolaskempf57 Nov 12, 2026
a3b9c9c
feat(charts): offer the save action only in the manual tab
nicolaskempf57 Nov 12, 2026
e588df0
fix(charts): blue filter add buttons and one height for the filter fi…
nicolaskempf57 Nov 12, 2026
f8d98ca
Merge remote-tracking branch 'origin/main' into feat/ai-charts-no-sql
nicolaskempf57 Nov 13, 2026
9b39ae3
fix(components): capture chart images at the harmonized card ratio
nicolaskempf57 Nov 13, 2026
43adace
refactor(charts): build the chart form from its content in one place
nicolaskempf57 Nov 13, 2026
49b45f6
refactor: review cleanups
nicolaskempf57 Nov 13, 2026
3f1040d
fix(assistant): load the chat on demand and keep zod from probing eval
nicolaskempf57 Nov 13, 2026
1b54cd9
fix(charts): block saving a chart whose series differ in type or filter
nicolaskempf57 Nov 16, 2026
f475563
refactor(charts): read the groups left from api-tabular's next link
nicolaskempf57 Nov 16, 2026
ccd5730
fix(charts): ignore a second click on save while saving
nicolaskempf57 Nov 16, 2026
608decf
fix(charts): capture the chart once the latest change is shown
nicolaskempf57 Nov 16, 2026
ff61cf2
fix(charts): ignore a profile that answers after a resource change
nicolaskempf57 Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
CONTAINER_NAME: ${{ vars.CONTAINER_NAME }}
UDATA_WORKING_DIR: udata
MONGODB_TOOLS: mongodb-database-tools-ubuntu2404-x86_64-100.13.0
# Serves the metrics API, matomo.js and the Tabular API to the E2E tests, see tests/fake-services.ts
# Serves the assistant chat, the metrics API, matomo.js and the Tabular API to the E2E tests, see tests/fake-services.ts
FAKE_SERVICES_URL: http://localhost:3100
# Set to record the Tabular API fixtures from the real API instead of replaying them: each
# E2E shard then uploads what it recorded
Expand Down Expand Up @@ -340,6 +340,7 @@ jobs:
- name: Start cdata server
env:
NUXT_PUBLIC_API_BASE: http://localhost:7000
NUXT_PUBLIC_ASSISTANT_API_BASE: ${{ env.FAKE_SERVICES_URL }}
NUXT_PUBLIC_HOMEPAGE_HERO_IMAGES: "hero_15.png"
# Lets the matomo plugin load (tests/fake-services.ts serves an empty matomo.js,
# the tracking spec asserts what the app sends). CI pre-starts this server and
Expand Down
13 changes: 13 additions & 0 deletions E2E-TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,16 @@ pnpm run test:e2e
## Paramètres fréquemment utilisés
- `--project firefox`: Lance uniquement les tests pour firefox (existe aussi avec `--project chromium`)
- `--only-changed`: Lance uniquement les tests modifiés depuis le dernier commit, et les tests qui importent un fichier modifié

## Assistant factice

Les tests du configurateur de graphiques (`tests/visualizations/chart-configurator.spec.ts`, `chart-assistant.spec.ts`) ne parlent jamais à un vrai assistant : `tests/fake-services.ts` sert `POST /api/1/assistant/chat/` en flux Vercel AI (`tests/assistantApi.ts`).

- **Scénario par défaut** (fake-services) : au premier message de l'utilisateur, un appel `create_chart` (dep / max `n_cum_dose1`, histogramme, tri `axis_y-desc`, limite 5, sur la ressource de la requête) ; aux messages suivants, un appel `update_chart` (`y_axis.unit = "doses"`).
- **Scénario propre à un test** : `routeAssistantStream(page, stream)` (`tests/assistantApi.ts`) intercepte la requête du chat dans la page. `stream` est un flux (`createChartStream(resourceId, output)`, `updateChartStream()`) ou une fonction du corps de la requête. `chart-assistant.spec.ts` s'en sert pour scripter un graphique sur les colonnes du profil de la ressource mockée (`tests/visualizations/profile.json`).
- Les données tabulaires sont mockées par `mockTabular` ; `setupChart` l'appelle, donc une route `/data/` propre à un test doit être déclarée **après** `setupChart` pour être prise en compte.

### Pièges

- **Port des faux services** : Playwright démarre les faux services en local sur le port 3100 par défaut. Si ce port est occupé (par exemple par un frontend de démo), définir `FAKE_SERVICES_URL` (ex. `FAKE_SERVICES_URL=http://localhost:3109`) : le port de cette URL est utilisé pour le serveur.
- **Serveur déjà lancé** : `reuseExistingServer` est actif. Un `pnpm dev` déjà lancé ne reçoit pas l'environnement du `webServer` (`NUXT_PUBLIC_ASSISTANT_API_BASE`) : les tests de l'assistant visent alors la vraie `apiBase`. Lancer le serveur avec `NUXT_PUBLIC_ASSISTANT_API_BASE=<FAKE_SERVICES_URL>` (en CI, c'est l'étape « Start cdata server »).
6 changes: 6 additions & 0 deletions assets/css/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@
.hero-breadcrumb .fr-breadcrumb__link[aria-current]:not([aria-current="false"]) {
color: rgba(255, 255, 255, 0.8);
}

/* DSFR puts cursor: pointer on the whole details element: only its summary toggles it,
and DSFR keeps the pointer on the summary with its own rule. */
details {
cursor: auto;
}
28 changes: 28 additions & 0 deletions components/Assistant/AssistantSpinner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<span
aria-hidden="true"
class="inline-flex w-[4.5ch] shrink-0 justify-center font-mono leading-none tabular-nums"
>{{ FRAMES[frameIndex] }}</span>
</template>

<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue'

// The "dna" braille spinner of unicode-animations (MIT), inlined to avoid the dependency.
const FRAMES = ['⠋⠉⠙⠚', '⠉⠙⠚⠒', '⠙⠚⠒⠂', '⠚⠒⠂⠂', '⠒⠂⠂⠒', '⠂⠂⠒⠲', '⠂⠒⠲⠴', '⠒⠲⠴⠤', '⠲⠴⠤⠄', '⠴⠤⠄⠋', '⠤⠄⠋⠉', '⠄⠋⠉⠙']
const INTERVAL_MS = 80
const STILL_FRAME = Math.floor(FRAMES.length / 2)

const frameIndex = ref(STILL_FRAME)
let timer: ReturnType<typeof setInterval> | undefined

onMounted(() => {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
frameIndex.value = 0
timer = setInterval(() => {
frameIndex.value = (frameIndex.value + 1) % FRAMES.length
}, INTERVAL_MS)
})

onBeforeUnmount(() => clearInterval(timer))
</script>
85 changes: 85 additions & 0 deletions components/Assistant/AssistantThinking.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<template>
<div
v-if="responding"
class="flex items-center gap-1.5 text-[11px] leading-5 text-new-gray-medium"
aria-hidden="true"
data-testid="assistant-responding"
>
<AssistantSpinner class="text-[11px]" />
<span
class="assistant-shimmer"
:data-text="$t('Réponse en cours…')"
>{{ $t('Réponse en cours…') }}</span>
</div>
<div
v-else
class="flex items-start gap-2 py-1 text-[13px]"
data-testid="assistant-thinking"
>
<span class="sr-only">{{ $t('L’assistant réfléchit…') }}</span>
<!-- The shimmer repeats the label in a pseudo-element, which screen readers
may read twice: the sr-only text above is the spoken one. -->
<span
class="flex h-5 shrink-0 items-center text-xs text-new-gray-medium"
aria-hidden="true"
>
<AssistantSpinner />
</span>
<div
class="min-w-0"
aria-hidden="true"
>
<p
class="assistant-shimmer m-0 leading-5"
:data-text="$t('Planification de la réponse…')"
>
{{ $t('Planification de la réponse…') }}
</p>
<p class="m-0 mt-0.5 text-xs leading-5 text-new-gray-medium">
{{ $t('Compréhension de la question et choix des opérations utiles') }}
</p>
</div>
</div>
</template>

<script setup lang="ts">
import AssistantSpinner from './AssistantSpinner.vue'

defineProps<{
/** The reply has started showing: a discreet line replaces the planning block. */
responding: boolean
}>()
</script>

<style scoped>
.assistant-shimmer {
position: relative;
display: inline-block;
color: var(--color-new-gray-medium-hover);
}

.assistant-shimmer::before {
content: attr(data-text);
position: absolute;
inset: 0;
pointer-events: none;
background-image: linear-gradient(90deg, transparent 40%, var(--color-new-gray-dark) 50%, transparent 60%);
background-size: 400% 100%;
background-repeat: no-repeat;
background-clip: text;
color: transparent;
animation: assistant-shimmer 2s linear infinite;
}

@keyframes assistant-shimmer {
from { background-position: 100% 0; }
to { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
.assistant-shimmer::before {
animation: none;
content: none;
}
}
</style>
Loading
Loading