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
80 changes: 40 additions & 40 deletions Sources/WeiBei/Resources/Editor/editor-entry.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Sources/WeiBei/Resources/Editor/editor-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"assets": [
{
"name": "editor-entry.js",
"bytes": 598988,
"sha256": "d7eb7f477b05b7d255e8e2d97d5c70f258db5c988c9f5ba11ac506b483b6f67f"
"bytes": 598840,
"sha256": "6c58c364c03bee4f6f5c5ef16032518586f1a8d00bf4beb42b9106e7840522f0"
},
{
"name": "editor.css",
Expand Down Expand Up @@ -333,8 +333,8 @@
},
{
"name": "viewer-entry.js",
"bytes": 518856,
"sha256": "0ede6a316b2487e867fb58a695527f6558444b333e6fe78bd25dd2fb83da06e4"
"bytes": 518708,
"sha256": "bacddcf53fea5d5b39c4a85bd73f4c558a0975692a1ae4f5b4c4a8c563f51705"
}
]
}
66 changes: 33 additions & 33 deletions Sources/WeiBei/Resources/Editor/viewer-entry.js

Large diffs are not rendered by default.

21 changes: 7 additions & 14 deletions Sources/WeiBei/WebEditor/src/streaming-appearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,15 @@ export function streamingAppearancePlugin(isStreamingActive: () => boolean): Plu
},
},
props: {
// Once the streaming session is over the caret is gone, but in-flight
// fades keep their spans until they expire so the last streamed
// characters finish their 260ms fade instead of popping to full
// opacity when the finish repaint unwraps the decoration spans.
// Hidden entirely once the streaming session is over: re-serving the
// remaining fades would RE-CREATE their span elements, and a fresh
// wb-stream-in span replays its 260ms fade from opacity 0 — the
// just-typed text visibly vanished and faded back in at completion.
// Unwrapping completed spans is visually silent; mid-flight ones pop
// to full opacity, which reads as the line finishing.
decorations(state) {
const appearance = appearanceKey.getState(state) as AppearanceState | undefined;
if (!appearance) return DecorationSet.empty;
if (!isStreamingActive()) {
const now = Date.now();
const remaining = appearance.fades.filter((entry) => now < entry.expiresAt);
if (remaining.length === 0) return DecorationSet.empty;
return DecorationSet.create(
state.doc,
remaining.map((entry) => Decoration.inline(entry.from, entry.to, FADE_SPEC)),
);
}
if (!appearance || !isStreamingActive()) return DecorationSet.empty;
return appearance.set;
},
},
Expand Down