Skip to content

Commit 41aa12b

Browse files
committed
fix(editor): keep textarea scrollable past MAX_ROWS + theme the clock colour
Address gemini's PR #93 findings: - overflow-y-hidden meant content past MAX_ROWS was unreachable (no scroll, no expand). Switch to overflow-y-auto with the scrollbar visually hidden so wheel/keyboard scrolling still works and the mirror layer stays pixel-aligned (a visible scrollbar would shift the textarea's text origin and break the highlight). - Hardcoded `#67c8e0` clock-marker colour replaced with a themed --color-info CSS var. Light + dark palettes get distinct values so the clock highlight stays readable on both. Picker dropdown consumes the same token via `text-info`.
1 parent 5275ea5 commit 41aa12b

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎src/components/Properties/TemplateContentInput.tsx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,19 @@ export function TemplateContentInput({
153153
) : s.kind === "var" ? (
154154
<span key={i} className="text-accent">{s.text}</span>
155155
) : (
156-
<span key={i} className="text-[#67c8e0]">{s.text}</span>
156+
<span key={i} className="text-info">{s.text}</span>
157157
),
158158
)}
159159
{value.endsWith("\n") ? " " : ""}
160160
</div>
161161
<textarea
162162
ref={taRef}
163-
className={`${SHARED_CLS} relative block resize-none overflow-y-hidden caret-text focus:border-accent focus:outline-none`}
163+
// overflow-y-auto so content beyond MAX_ROWS stays reachable;
164+
// scrollbar visually hidden because the mirror layer doesn't
165+
// reserve space for one — a visible scrollbar would shift the
166+
// textarea's text origin and misalign the colour highlight.
167+
// Wheel + keyboard scrolling stay functional via syncScroll.
168+
className={`${SHARED_CLS} relative block resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden caret-text focus:border-accent focus:outline-none`}
164169
style={{ color: "transparent", background: "transparent" }}
165170
value={value}
166171
maxLength={maxLength}
@@ -209,7 +214,7 @@ export function TemplateContentInput({
209214
className="block w-full text-left px-2 py-1 text-xs font-mono text-text hover:bg-surface-2 transition-colors"
210215
onClick={() => insertMarker(`clock:${token}`)}
211216
>
212-
<span className="text-[#67c8e0]">«clock:{token}»</span>{" "}
217+
<span className="text-info">«clock:{token}»</span>{" "}
213218
<span className="text-muted">{t.app[labelKey]}</span>
214219
</button>
215220
))}

‎src/index.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
--color-muted: #666666;
2525
--color-accent: #f59e0b;
2626
--color-accent-dim:#78490a;
27+
/* Secondary highlight, e.g. clock-token markers in the content
28+
editor — distinct from accent so the editor can colour-code
29+
marker families without collision. */
30+
--color-info: #67c8e0;
2731

2832
--font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
2933
--font-mono: 'IBM Plex Mono', ui-monospace, monospace;
@@ -43,6 +47,7 @@
4347
--color-muted: #52525b;
4448
--color-accent: #d97706;
4549
--color-accent-dim:#fef3c7;
50+
--color-info: #0e7490;
4651
}
4752

4853
*, *::before, *::after {

0 commit comments

Comments
 (0)