Schema editor: a comment line before a continued directive keeps the table as text
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- graphql, typescript
- Ambito
- frontend
Direzione di ricerca
Start in parseFields in src/features/instance/applications/lib/schema/parseSchema.ts, where a comment line between a field's type and its continued directive ends the field. Then check generateTable in serializeSchema.ts, which must emit the captured comment above the directive block. The regression test "a comment between a field and its continued directive" in serializeSchema.test.ts currently locks in the text fallback and will need updating. Done when the example table parses visually, the comment survives an edit and round-trip, and the test passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The visual schema editor can't edit a table when a # comment line sits between a field and the directive continued on the lines below it:
type Product @table(audit: true) {
id: ID @primaryKey
title: String
catalogSearch: FullText
# searches the title
@fullText(fields: [{ name: "title" }])
}
The parser reads directives continued onto following lines (the layout Harper's docs use for @fullText), but a comment line in that gap ends the field. The table then stays raw text: nothing is lost, and "Edit as text" still works, but the visual editor doesn't offer it.
Why it was left
Carrying the comment through a regeneration needs a place in the field model for comments between a field's type and its continued directives. Without one, parsing past the comment would drop it on the next edit. Keeping the table as text is the safe behavior, and a regression test records it (serializeSchema.test.ts, "a comment between a field and its continued directive").
What would fix it
Capture comment lines between a field's type and its continued directives in parseFields (src/features/instance/applications/lib/schema/parseSchema.ts), and emit them above the directive block in generateTable (serializeSchema.ts).
Found in the pre-push review of the full-text work for #2014.
Review-Deferral: 5dc0829d5b20df5d severity=nit category=correctness
- Lingua principale
- TypeScript
- Stelle
- 5
- Fork
- 4
- Merge medio
- 2g 13h
- PR unite (30g)
- 60
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di HarperFast/studio
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
HarperFast/studio#2111 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
HarperFast/studio#2109 ·
I maintainer di solito rispondono entro 1 giorno
-
rum
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
HarperFast/studio#2085 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HarperFast/studio#2070 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HarperFast/studio#2067 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di HarperFast/studio
Issue simili
-
area: batch
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
inabagumi/shinju-date#7294 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
streaming-video-technology-alliance/common-media-library#700 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vercel-labs/ui#809 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
KrisCris/village-in-the-shade-guide#75 ·
I maintainer di solito rispondono entro 1 giorno
-
bot:ai-assisted component:platform-js status:untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
midnightntwrk/platform-js#38 ·