Skip to content

feat(tutor): simplify syllabus generator UX and fix editing/export bugs - #169

Merged
noor-lpi merged 2 commits into
mainfrom
feat/tutor-ux-cleanup
Sep 30, 2026
Merged

noor-lpi merged 2 commits into
mainfrom
feat/tutor-ux-cleanup

Conversation

@noor-lpi

Copy link
Copy Markdown
Contributor

Why

The syllabus generator (/tutor) showed all steps at once, used long and sometimes inaccurate copy, and had vague loading/error popups. This PR makes the flow step-by-step and clear, in EN and FR, and fixes several bugs found along the way.

The hidden /tutor_test page is not changed: SecondStep.vue and the tutor.summaries.* / tutor.secondStep.* keys it uses are kept as-is; /tutor now uses its own ResourcesStep.vue and new keys.

UX changes

  • Step bar: labelled, compact, reuses Micro-learning's ProgressBar.vue (new optional labels / clickable props; Micro-learning unchanged)
  • One step at a time: only reached steps are shown; finished steps fold into a one-line recap with Edit / Close
  • Documents: drag-and-drop area with a file list (replaces cloned DOM inputs), limits shown up front, course details marked "Strongly recommended" with a non-blocking nudge, language dropdown fixed
  • Summary: plain editable textareas instead of Edit/Validate toggles
  • Resources: list with checkboxes, clear text hierarchy, "n resources selected" counter, bookmarks
  • Syllabus: always-visible "Ask for changes" box, scroll to top after regenerating, click-to-edit, Google-Docs-style "Open ↗" bubble for links (new tab)
  • Popups: per-step loading/error messages, Try again / Cancel, close button inside the box, cancelling really aborts the request (AbortController)
  • Copy: rewritten in EN + FR with identical keys

Bug fixes

  • Failed generation no longer lands on an empty step 4 (retry popup instead)
  • Search errors no longer leave the loader stuck
  • "Start a new syllabus" fully resets (files, summaries, syllabus)
  • Editing the syllabus keeps markdown (headings, bold, lists, tables) via turndown + turndown-plugin-gfm, and only saves after real typing (clicking links no longer rewrites it); <br> in table cells survives edits
  • Literal \n written by the LLM is cleaned up (<br> in tables, new line elsewhere)
  • Word export (utils/md-to-docx): real tables for both |---| and | --- | separators, clean headings (no **), markdown / HTML / bare links incl. [[lien]](url), horizontal rules, formatted table cells, less empty spacing

Notes

  • New deps: turndown, turndown-plugin-gfm, @types/turndown
  • Feedback requests keep sending only the selected resources: confirmed as intended backend behaviour
  • Not in scope: AI output is rendered with v-html without sanitising (syllabus + chat); recommend a separate ticket (DOMPurify)

Tests

  • Unit: 42 passing, incl. new ThirdStep.spec.ts (link bubble, no rewrite without typing, table line breaks, \n cleanup) and md-to-docx.spec.ts (inline links, full Word export checked via the generated XML)
  • E2E: e2e/tutor.spec.ts updated for the new file upload (3 passing)
  • Manually tested end to end in EN and FR against the dev backend

🤖 Generated with Claude Code

Noor A and others added 2 commits September 30, 2026 14:43
- Show one step at a time with a labelled step bar (shared ProgressBar)
  and collapsible recaps of finished steps
- Rewrite EN/FR copy; per-step loading and error messages; cancel aborts requests
- Documents: drop zone with file list, course details marked recommended
  with a nudge, fixed language dropdown
- Summary: plain editable textareas
- Resources: list with checkboxes, selection counter, bookmarks
  (own ResourcesStep.vue, SecondStep.vue kept for /tutor_test)
- Syllabus: always-visible feedback box, scroll to top after regenerating,
  link "open" bubble, markdown preserved on edit (turndown), only saved
  after real typing, literal "\n" from the LLM cleaned up
- Word export: real tables for both separator styles, clean headings,
  markdown/HTML/bare links, horizontal rules, formatted table cells
- Fix: failed generation no longer shows an empty step 4, search errors
  no longer leave the loader stuck, restart fully resets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noor-lpi noor-lpi self-assigned this Sep 30, 2026
}
/* restyle the shared card: clear hierarchy, no inner hover or empty number column */
.source :deep(.block.is-flex.is-fullwidth) {
padding: 0 !important;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

important! should be avoided, best practice would be to have a specific card or use props to change style to the card

Comment thread src/localisation/fr.ts
title: 'Rédaction de votre syllabus',
description:
'WeLearn génère votre syllabus à partir des documents fournis. Cette étape peut prendre quelques minutes.'
'WeLearn combine vos documents, les informations du cours et les ressources. Cela peut prendre jusqu’à une minute : merci de ne pas fermer ni recharger la page.'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 juste ce ne sera pas vrai si la var de env fait utiliser les 3 agents

Comment thread src/stores/tutor.ts
content
.split('\n')
.map((line) =>
line.trim().startsWith('|') ? line.replace(/\\n/g, '<br>') : line.replace(/\\n/g, '\n')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this clean be made in the API ?

Comment thread src/views/TutorPage.vue
: t('tutor.resourcesStep.recapAll')
}));

watch(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@noor-lpi
noor-lpi merged commit 2dfe460 into main Sep 30, 2026
7 of 9 checks passed
@noor-lpi
noor-lpi deleted the feat/tutor-ux-cleanup branch September 30, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants