fix: normalize dataDir path separator and add mobile highlight support#156
Conversation
…ighlight support - Add HuntlyEnvironmentPostProcessor to ensure huntly.dataDir always ends with a path separator before Spring resolves the datasource URL, fixing SQLite DB creation at wrong path on Windows (#155) - Register processor via META-INF/spring.factories; add 6 unit tests - Add touchend/pointerup/selectionchange listeners with 80ms debounce to TextHighlighter so mobile long-press selection triggers the highlight tooltip (#154) - Add WebkitUserSelect and touchAction styles for broader mobile compatibility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Augment PR SummarySummary: This PR fixes a Windows-specific SQLite path concatenation bug and improves text highlight selection handling on mobile devices. Changes:
Technical Notes: Normalizing 🤖 Was this summary useful? React with 👍 or 👎 |
| currentRef.addEventListener('touchend', scheduleHandleSelection); | ||
| currentRef.addEventListener('pointerup', scheduleHandleSelection); | ||
| } | ||
| document.addEventListener('selectionchange', scheduleHandleSelection); |
There was a problem hiding this comment.
app/client/src/components/highlights/TextHighlighter.tsx:513: selectionchange is registered on document, so it can still schedule timers and trigger setSelectionTooltip updates for selection changes outside the article (and even when highlightModeEnabled is false). Is that global behavior intentional, or should selection handling be scoped to the active highlight mode/content container to avoid unintended state churn?
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
HuntlyEnvironmentPostProcessorthat runs before Spring resolves the datasource URL, ensuringhuntly.dataDiralways ends with/. Previously, passing--huntly.dataDir=C:\Users\name\huntly(no trailing slash) causedjdbc:sqlite:C:\Users\name\huntlydb.sqlite— the separator was missing. Registered viaMETA-INF/spring.factories. 6 unit tests added.TextHighlighterpreviously only listened tomouseup, which does not fire on mobile. Addedtouchend,pointerup, and document-levelselectionchange(with 80 ms debounce) so long-press text selection on iOS/Android correctly triggers the highlight tooltip. Also addedWebkitUserSelect: textandtouchAction: autoto the content container for broader mobile compatibility.Test plan
./mvnw test -pl huntly-server -am -DfailIfNoTests=false— all 48 tests pass including 6 newHuntlyEnvironmentPostProcessorTestcasesyarn tsc --noEmit— no type errors--huntly.dataDir=C:\path\without\trailing\slash, verifydb.sqlitelands inside that directoryCloses #155
Closes #154
🤖 Generated with Claude Code