Add HTML5 authoring SSE updates
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 02:41:02 +03:00
parent de7248db9e
commit fb66cfba6f
3 changed files with 17 additions and 3 deletions
+10 -3
View File
@@ -206,7 +206,13 @@ def render_html5_editor(
tree_nodes = objects[:120] or modules[:120]
selected_module = modules[0] if modules else None
content = f"""
<main class="workspace" data-html5-page="editor" data-project-id="{escape(project_id)}">
<main
class="workspace"
data-html5-page="editor"
data-project-id="{escape(project_id)}"
hx-ext="sse"
sse-connect="/html5/projects/{quote(project_id)}/events"
>
{_topbar(project_id, project_nav)}
<section class="layout">
<aside class="panel tree" data-html5-tree>
@@ -259,7 +265,7 @@ def render_html5_editor(
{render_html5_authoring_changes(project_id, None)}
</aside>
</section>
<footer class="status" data-html5-status hx-ext="sse" sse-connect="/html5/projects/{quote(project_id)}/events" sse-swap="status">
<footer class="status" data-html5-status sse-swap="status">
{render_html5_status(project_id, snapshot)}
</footer>
</main>
@@ -651,6 +657,7 @@ def render_html5_authoring_changes(project_id: str, changes: Iterable[object] |
data-html5-authoring-changes
hx-get="/html5/projects/{quote(project_id)}/authoring/changes"
hx-trigger="load"
sse-swap="authoring-changes"
hx-swap="outerHTML"
>
<div class="panel-title">Authoring</div>
@@ -667,7 +674,7 @@ def render_html5_authoring_changes(project_id: str, changes: Iterable[object] |
class="authoring-panel"
data-html5-authoring-changes
hx-get="/html5/projects/{quote(project_id)}/authoring/changes"
hx-trigger="every 15s"
sse-swap="authoring-changes"
hx-swap="outerHTML"
>
<div class="panel-title">Authoring · {len(change_list)}</div>