Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI/CD

on:
push:
branches: [ main ]
branches: [ main, beta ]
tags: ['v*']
paths-ignore:
- '**.md'
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
if: |
always() &&
github.event_name != 'pull_request' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/tags/v')) &&
(startsWith(github.ref, 'refs/tags/v') ||
needs.changes.outputs.backend == 'true' ||
needs.changes.outputs.frontend == 'true') &&
Expand Down Expand Up @@ -181,8 +181,11 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_PREFIX }}/${{ matrix.component }}
flavor: |
latest=false
tags: |
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=beta,enable=${{ github.ref == 'refs/heads/beta' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/components/Editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
content: this.content,
debounce: 50,
shouldShow: (view) => {
if (view.composing) return false
const currentText = this.provider.getContent(
view,
(node) => ['paragraph', 'heading'].includes(node.type.name)
Expand Down Expand Up @@ -230,6 +231,9 @@
update(view) {
this.view = view
this.editorViewRef.current = view
// Don't query or mutate menu state mid-IME — coordsAtPos / DOM writes
// triggered here can drop in-flight composition characters on Windows.
if (view.composing) return
this.provider.update(view)
}

Expand Down Expand Up @@ -453,6 +457,10 @@
return {
update(view) {
wikilinkMenu._view = view
// Bail during IME composition: coordsAtPos + DOM writes from
// show()/hide() can disturb the active composition on Windows,
// making characters disappear and the cursor jump.
if (view.composing) return
const { state } = view
const { selection } = state
if (!(selection instanceof TextSelection)) {
Expand Down Expand Up @@ -516,6 +524,12 @@
ctx.set(rootCtx, containerRef.current)
ctx.set(defaultValueCtx, defaultValue)
ctx.get(listenerCtx).markdownUpdated((_ctx, markdown) => {
// Skip parent state updates while IME composition is active —
// the React re-render they trigger can interrupt composition on
// Windows. ProseMirror dispatches a final transaction at
// compositionend, which fires the listener again with the
// committed text, so no input is lost.
if (editorViewRef.current?.composing) return
onChangeRef.current?.(markdown)
})
let slashMenuView = null
Expand Down Expand Up @@ -562,10 +576,10 @@
editorViewRef.current = null
// Clear leftover DOM from any editor
if (containerRef.current) {
containerRef.current.innerHTML = ''

Check warning on line 579 in frontend/src/components/Editor/Editor.jsx

View workflow job for this annotation

GitHub Actions / frontend-tests

The ref value 'containerRef.current' will likely have changed by the time this effect cleanup function runs. If this ref points to a node rendered by React, copy 'containerRef.current' to a variable inside the effect, and use that variable in the cleanup function
}
}
}, [])

Check warning on line 582 in frontend/src/components/Editor/Editor.jsx

View workflow job for this annotation

GitHub Actions / frontend-tests

React Hook useEffect has a missing dependency: 'defaultValue'. Either include it or remove the dependency array

// Image paste handler
useEffect(() => {
Expand Down
Loading