#225 Edytor Markdown'a - #278
Open
Qufel wants to merge 28 commits into
Open
Conversation
|
The preview deployment for frontend-testownik-dev is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-07-13 12:17:43 CET |
Antoni-Czaplicki
requested changes
Jun 18, 2026
Antoni-Czaplicki
left a comment
Member
There was a problem hiding this comment.
Note
AI-generated review comment.
I reviewed the Markdown/LaTeX editor PR against current dev, including the editor integration, quiz display rendering, tests, build/typecheck/lint behavior, and mergeability.
Main blockers:
- The PR is currently not mergeable. GitHub reports it as
CONFLICTING; the conflict areas includepnpm-lock.yamlandsrc/components/ai/ai-explain-card.tsx. pnpm lintfails locally with 18@typescript-eslint/no-unsafe-*route typing errors after this PR's dependency/lockfile refresh.pnpm typecheckpasses afterpnpm next typegen, and the create-quiz page tests pass with a larger timeout, but lint needs to be clean before merge.- The OverType preview/value synchronization issue called out inline can make existing editor content render blank/stale.
Needed to merge: rebase/merge current dev and resolve conflicts, fix the lint regression or narrow the lockfile/tooling bump, fix the OverType controlled-value/initial-preview behavior, and add a targeted regression test for existing quiz text or parent-driven value updates in the editor.
Antoni-Czaplicki
force-pushed
the
dev
branch
2 times, most recently
from
July 1, 2026 23:46
eaddd9b to
f57961b
Compare
Comment on lines
+178
to
+181
| if (isInMathBlock(ta)) { | ||
| formats.splice(formats.indexOf("inlineMath"), 1); | ||
| formats.push("blockMath"); | ||
| } |
Comment on lines
+183
to
+186
| if (isInCodeBlock(ta)) { | ||
| formats.splice(formats.indexOf("code"), 1); | ||
| formats.push("blockCode"); | ||
| } |
Comment on lines
+218
to
+222
| const styleId = "#ot-math-styles"; | ||
| if (document.querySelector(styleId) === null) { | ||
| const style = document.createElement("style"); | ||
| style.id = styleId; | ||
| style.textContent = ` |
Comment on lines
+281
to
+284
| return () => { | ||
| observer.disconnect(); | ||
| document.querySelector(styleId)?.remove(); | ||
| }; |
Comment on lines
+236
to
+239
| for (const child of node.childNodes) { | ||
| if (child.nodeType !== Node.TEXT_NODE) { | ||
| return; | ||
| } |
Comment on lines
+240
to
+243
| const text = child.textContent ?? ""; | ||
| if (!text.includes("$")) { | ||
| return; | ||
| } |
olios123
reviewed
Jul 13, 2026
Comment on lines
+1
to
+4
| // eslint-disable-next-line import/no-named-as-default | ||
| import OverType from "overtype"; | ||
| import type { OverTypeInstance, Theme } from "overtype"; | ||
| import { useEffect, useRef } from "react"; |
| @@ -0,0 +1,953 @@ | |||
| import { | |||
Comment on lines
+178
to
+181
| if (isInMathBlock(ta)) { | ||
| formats.splice(formats.indexOf("inlineMath"), 1); | ||
| formats.push("blockMath"); | ||
| } |
Comment on lines
+183
to
+186
| if (isInCodeBlock(ta)) { | ||
| formats.splice(formats.indexOf("code"), 1); | ||
| formats.push("blockCode"); | ||
| } |
Comment on lines
+218
to
+221
| const styleId = "#ot-math-styles"; | ||
| if (document.querySelector(styleId) === null) { | ||
| const style = document.createElement("style"); | ||
| style.id = styleId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Podsumowanie
Dodano edytor markdown wykorzystujący logikę istniejącego już edytora Overtype. Edytor jest dostosowany zarówno do PC jak i urządzeń mobilnych.
Poprawiono renderowanie pytań w quizie, ze względu na złe wyświetlanie markdownu w starej wersji.
Dodano
OverTypeEditorwraz z toolbaremuseOverTypeinicjalizujący referencję do edytoraquestion-card.tsxZmiana w wyświetlaniu pytania
Wyświetlanie pytań obecnie usuwało formatowanie z pierwszej linii tekstu, przez co tekst nie wyświetlał się poprawnie

Po wprowadzeniu zmian przeniosłem tekst "Pytanie" wraz z numerem pytania w celu poprawnego formatowania do osobnego elemntu, rozdzielając treść od numeracji.

Edytor
Domyślnie treść edytora wyświetlana jest w trybie podglądu

Po nacisnięciu przycisku "Edytuj" zmienia się on na "Podgląd" jeśli użytkownik chciałby zobaczyć jak wygląda wygenerowany markdown. W tej chwili możemy dowolnie edytować tekst oraz korzystać z przycisków na toolbarze

W mobilnym widoku toolbar zmienia się na dropdown zawierający wszystkie opcje.
CLOSES #225