From 029417f1c3562a07a4294a2be041ab6062f3edf6 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sat, 15 May 2021 17:29:17 +0200 Subject: [PATCH 1/3] Add annotations to step --- packs/step-parser/src/step-parser.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packs/step-parser/src/step-parser.ts b/packs/step-parser/src/step-parser.ts index a9aad7ad..a1a0be85 100644 --- a/packs/step-parser/src/step-parser.ts +++ b/packs/step-parser/src/step-parser.ts @@ -41,6 +41,7 @@ export function parseSteps( longestLineIndex: number; title?: string; subtitle?: string; + annotations: Record; }[] = []; steps.forEach((step, i) => { @@ -67,7 +68,8 @@ export function parseSteps( focusCount, longestLineIndex: getLongestLineIndex(code), title: inputSteps[i].title, - subtitle: inputSteps[i].subtitle + subtitle: inputSteps[i].subtitle, + annotations: inputSteps[i].annotations }); }); From 18992ff877341e20d18e7a079b3a4f608066b105 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sat, 15 May 2021 17:32:32 +0200 Subject: [PATCH 2/3] Display annotations --- packs/standalone/src/lines.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packs/standalone/src/lines.tsx b/packs/standalone/src/lines.tsx index 4bda05bc..55d1d37e 100644 --- a/packs/standalone/src/lines.tsx +++ b/packs/standalone/src/lines.tsx @@ -235,6 +235,7 @@ export function LineList({ {token} ))} + {stepPair.prev.annotations[lineKey + 1]} ) From d53a4a613ee07528ae5dbbcebabab8502c474f51 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sat, 15 May 2021 17:50:49 +0200 Subject: [PATCH 3/3] Don't fail if no annotations exist --- packs/standalone/src/lines.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packs/standalone/src/lines.tsx b/packs/standalone/src/lines.tsx index 55d1d37e..0fc5dc54 100644 --- a/packs/standalone/src/lines.tsx +++ b/packs/standalone/src/lines.tsx @@ -235,7 +235,7 @@ export function LineList({ {token} ))} - {stepPair.prev.annotations[lineKey + 1]} + {stepPair.prev.annotations?.[lineKey + 1]} )