feat(script): let the author write the script without daryl
c316a11 parent: 24cadf2 modified
web/src/i18n/locales/en/script.ts +4 -3 | @@ -1,9 +1,10 @@ | ||
| 1 | 1 | export default { |
| 2 | 2 | tabs: { script: "Script", research: "Research", notes: "Notes" }, |
| 3 | 3 | empty: { |
| 4 | - intro: "The script is written from the chosen angle: Daryl drafts a first version, split into sections, which you then refine here together.", | |
| 5 | - pickAngle: "Pick an angle in the Angle step first.", | |
| 6 | - write: "Write the script", | |
| 4 | + intro: "Write the script yourself, or let Daryl draft a first version from the chosen angle, split into sections, which you then refine here together.", | |
| 5 | + pickAngle: "For Daryl to write it, pick an angle in the Angle step first.", | |
| 6 | + self: "I'll write it myself", | |
| 7 | + write: "Have Daryl write it", | |
| 7 | 8 | }, |
| 8 | 9 | writing: "Writing the script…", |
| 9 | 10 | hint: "Select a passage: “+ Shot” to annotate it, Daryl to discuss it", |
| @@ -1,9 +1,10 @@ | |||
| 1 | export default { | 1 | export default { |
| 2 | tabs: { script: "Script", research: "Research", notes: "Notes" }, | 2 | tabs: { script: "Script", research: "Research", notes: "Notes" }, |
| 3 | empty: { | 3 | empty: { |
| 4 | - intro: "The script is written from the chosen angle: Daryl drafts a first version, split into sections, which you then refine here together.", | 4 | + intro: "Write the script yourself, or let Daryl draft a first version from the chosen angle, split into sections, which you then refine here together.", |
| 5 | - pickAngle: "Pick an angle in the Angle step first.", | 5 | + pickAngle: "For Daryl to write it, pick an angle in the Angle step first.", |
| 6 | - write: "Write the script", | 6 | + self: "I'll write it myself", |
| 7 | + write: "Have Daryl write it", | ||
| 7 | }, | 8 | }, |
| 8 | writing: "Writing the script…", | 9 | writing: "Writing the script…", |
| 9 | hint: "Select a passage: “+ Shot” to annotate it, Daryl to discuss it", | 10 | hint: "Select a passage: “+ Shot” to annotate it, Daryl to discuss it", |
modified
web/src/i18n/locales/fr/script.ts +4 -3 | @@ -1,9 +1,10 @@ | ||
| 1 | 1 | export default { |
| 2 | 2 | tabs: { script: "Script", research: "Recherche", notes: "Notes" }, |
| 3 | 3 | empty: { |
| 4 | - intro: "Le script s’écrit à partir de l’angle retenu : Daryl rédige une première version, découpée en sections, que tu retouches ensuite ici avec lui.", | |
| 5 | - pickAngle: "Retiens d’abord un angle à l’étape Angle.", | |
| 6 | - write: "Écrire le script", | |
| 4 | + intro: "Écris le script toi-même, ou laisse Daryl rédiger une première version à partir de l’angle retenu, découpée en sections, que tu retouches ensuite ici avec lui.", | |
| 5 | + pickAngle: "Pour que Daryl l’écrive, retiens d’abord un angle à l’étape Angle.", | |
| 6 | + self: "Je l’écris moi-même", | |
| 7 | + write: "Faire écrire par Daryl", | |
| 7 | 8 | }, |
| 8 | 9 | writing: "Écriture du script…", |
| 9 | 10 | hint: "Sélectionne un passage : « + Plan » pour l’annoter, Daryl pour en discuter", |
| @@ -1,9 +1,10 @@ | |||
| 1 | export default { | 1 | export default { |
| 2 | tabs: { script: "Script", research: "Recherche", notes: "Notes" }, | 2 | tabs: { script: "Script", research: "Recherche", notes: "Notes" }, |
| 3 | empty: { | 3 | empty: { |
| 4 | - intro: "Le script s’écrit à partir de l’angle retenu : Daryl rédige une première version, découpée en sections, que tu retouches ensuite ici avec lui.", | 4 | + intro: "Écris le script toi-même, ou laisse Daryl rédiger une première version à partir de l’angle retenu, découpée en sections, que tu retouches ensuite ici avec lui.", |
| 5 | - pickAngle: "Retiens d’abord un angle à l’étape Angle.", | 5 | + pickAngle: "Pour que Daryl l’écrive, retiens d’abord un angle à l’étape Angle.", |
| 6 | - write: "Écrire le script", | 6 | + self: "Je l’écris moi-même", |
| 7 | + write: "Faire écrire par Daryl", | ||
| 7 | }, | 8 | }, |
| 8 | writing: "Écriture du script…", | 9 | writing: "Écriture du script…", |
| 9 | hint: "Sélectionne un passage : « + Plan » pour l’annoter, Daryl pour en discuter", | 10 | hint: "Sélectionne un passage : « + Plan » pour l’annoter, Daryl pour en discuter", |
modified
web/src/project/steps/ScriptStep.vue +9 -2 | @@ -36,7 +36,10 @@ const blocks = computed(() => script.blocks.value ?? []); | ||
| 36 | 36 | const md = computed(() => toMarkdown(blocks.value)); |
| 37 | 37 | const writing = computed(() => running("script")); |
| 38 | 38 | const writeError = computed(() => failed("script")); |
| 39 | -const empty = computed(() => script.blocks.value !== null && !md.value.trim() && !project.value.runtime.has_script); | |
| 39 | +/** « Je l'écris moi-même » : l'éditeur s'ouvre sur une page blanche, sans passer par Daryl. */ | |
| 40 | +const selfWrite = ref(false); | |
| 41 | +const empty = computed(() => script.blocks.value !== null && !md.value.trim() && !project.value.runtime.has_script | |
| 42 | + && !selfWrite.value); | |
| 40 | 43 | const angle = computed(() => { |
| 41 | 44 | const p = project.value; |
| 42 | 45 | return p.angle_sel != null ? p.angles[p.angle_sel] ?? null : null; |
| @@ -323,7 +326,10 @@ function setNote(i: number, n: string): void { | ||
| 323 | 326 | <p>{{ t("script.empty.intro") }}</p> |
| 324 | 327 | <p v-if="angle" class="angle">{{ t("chat.quoted", { q: angle.t }) }}</p> |
| 325 | 328 | <p v-else>{{ t("script.empty.pickAngle") }}</p> |
| 326 | - <button class="btn dark lg" :disabled="!angle" @click="writeScript">{{ t("script.empty.write") }}</button> | |
| 329 | + <div class="actions"> | |
| 330 | + <button class="btn lg" @click="selfWrite = true">{{ t("script.empty.self") }}</button> | |
| 331 | + <button class="btn dark lg" :disabled="!angle" @click="writeScript">{{ t("script.empty.write") }}</button> | |
| 332 | + </div> | |
| 327 | 333 | <p v-if="writeError" class="error">{{ writeError }}</p> |
| 328 | 334 | </div> |
| 329 | 335 | </div> |
| @@ -464,6 +470,7 @@ function setNote(i: number, n: string): void { | ||
| 464 | 470 | .empty-state .dashed-box { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 32px; } |
| 465 | 471 | .empty-state p { margin: 0; } |
| 466 | 472 | .empty-state .angle { color: var(--ink); font-weight: 600; } |
| 473 | +.empty-state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; } | |
| 467 | 474 | |
| 468 | 475 | .script-layout { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 16px 24px 20px; } |
| 469 | 476 | |
| @@ -36,7 +36,10 @@ const blocks = computed(() => script.blocks.value ?? []); | |||
| 36 | const md = computed(() => toMarkdown(blocks.value)); | 36 | const md = computed(() => toMarkdown(blocks.value)); |
| 37 | const writing = computed(() => running("script")); | 37 | const writing = computed(() => running("script")); |
| 38 | const writeError = computed(() => failed("script")); | 38 | const writeError = computed(() => failed("script")); |
| 39 | -const empty = computed(() => script.blocks.value !== null && !md.value.trim() && !project.value.runtime.has_script); | 39 | +/** « Je l'écris moi-même » : l'éditeur s'ouvre sur une page blanche, sans passer par Daryl. */ |
| 40 | +const selfWrite = ref(false); | ||
| 41 | +const empty = computed(() => script.blocks.value !== null && !md.value.trim() && !project.value.runtime.has_script | ||
| 42 | + && !selfWrite.value); | ||
| 40 | const angle = computed(() => { | 43 | const angle = computed(() => { |
| 41 | const p = project.value; | 44 | const p = project.value; |
| 42 | return p.angle_sel != null ? p.angles[p.angle_sel] ?? null : null; | 45 | return p.angle_sel != null ? p.angles[p.angle_sel] ?? null : null; |
| @@ -323,7 +326,10 @@ function setNote(i: number, n: string): void { | |||
| 323 | <p>{{ t("script.empty.intro") }}</p> | 326 | <p>{{ t("script.empty.intro") }}</p> |
| 324 | <p v-if="angle" class="angle">{{ t("chat.quoted", { q: angle.t }) }}</p> | 327 | <p v-if="angle" class="angle">{{ t("chat.quoted", { q: angle.t }) }}</p> |
| 325 | <p v-else>{{ t("script.empty.pickAngle") }}</p> | 328 | <p v-else>{{ t("script.empty.pickAngle") }}</p> |
| 326 | - <button class="btn dark lg" :disabled="!angle" @click="writeScript">{{ t("script.empty.write") }}</button> | 329 | + <div class="actions"> |
| 330 | + <button class="btn lg" @click="selfWrite = true">{{ t("script.empty.self") }}</button> | ||
| 331 | + <button class="btn dark lg" :disabled="!angle" @click="writeScript">{{ t("script.empty.write") }}</button> | ||
| 332 | + </div> | ||
| 327 | <p v-if="writeError" class="error">{{ writeError }}</p> | 333 | <p v-if="writeError" class="error">{{ writeError }}</p> |
| 328 | </div> | 334 | </div> |
| 329 | </div> | 335 | </div> |
| @@ -464,6 +470,7 @@ function setNote(i: number, n: string): void { | |||
| 464 | .empty-state .dashed-box { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 32px; } | 470 | .empty-state .dashed-box { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 32px; } |
| 465 | .empty-state p { margin: 0; } | 471 | .empty-state p { margin: 0; } |
| 466 | .empty-state .angle { color: var(--ink); font-weight: 600; } | 472 | .empty-state .angle { color: var(--ink); font-weight: 600; } |
| 473 | +.empty-state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; } | ||
| 467 | 474 | ||
| 468 | .script-layout { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 16px 24px 20px; } | 475 | .script-layout { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 16px 24px 20px; } |
| 469 | 476 | ||
modified
web/src/project/steps/script/ScriptEditor.vue +2 -0 | @@ -85,6 +85,8 @@ const ends = ref<[string, string[]][]>([]); | ||
| 85 | 85 | const editor = useEditor({ |
| 86 | 86 | extensions: [StarterKit.configure({ link: { openOnClick: false } }), Markdown, BlockId, Cues, Plans(host), Preview], |
| 87 | 87 | editable: !props.readonly, |
| 88 | + // un script vide qu'on ouvre pour l'écrire soi-même : le curseur est déjà dedans | |
| 89 | + autofocus: !props.readonly && !props.blocks.length ? "end" : false, | |
| 88 | 90 | onUpdate: schedule, |
| 89 | 91 | onTransaction: ({ editor: e }) => { |
| 90 | 92 | const st = plansKey.getState(e.state); |
| @@ -85,6 +85,8 @@ const ends = ref<[string, string[]][]>([]); | |||
| 85 | const editor = useEditor({ | 85 | const editor = useEditor({ |
| 86 | extensions: [StarterKit.configure({ link: { openOnClick: false } }), Markdown, BlockId, Cues, Plans(host), Preview], | 86 | extensions: [StarterKit.configure({ link: { openOnClick: false } }), Markdown, BlockId, Cues, Plans(host), Preview], |
| 87 | editable: !props.readonly, | 87 | editable: !props.readonly, |
| 88 | + // un script vide qu'on ouvre pour l'écrire soi-même : le curseur est déjà dedans | ||
| 89 | + autofocus: !props.readonly && !props.blocks.length ? "end" : false, | ||
| 88 | onUpdate: schedule, | 90 | onUpdate: schedule, |
| 89 | onTransaction: ({ editor: e }) => { | 91 | onTransaction: ({ editor: e }) => { |
| 90 | const st = plansKey.getState(e.state); | 92 | const st = plansKey.getState(e.state); |