Link HTML5 object selection to symbol detail
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-17 00:47:39 +03:00
parent 6f594395f8
commit 9c4d02616f
3 changed files with 10 additions and 3 deletions
+4 -2
View File
@@ -1085,10 +1085,11 @@ def render_html5_symbols(snapshot: SirSnapshot, q: str, project_id: str | None =
return "".join(_symbol_result(node, project_id) for node in results)
def render_html5_symbol_detail(project_id: str, references: object | None) -> str:
def render_html5_symbol_detail(project_id: str, references: object | None, *, oob: bool = False) -> str:
oob_attr = ' hx-swap-oob="outerHTML"' if oob else ""
if references is None:
return f"""
<div class="symbol-detail" data-html5-symbol-detail>
<div class="symbol-detail" data-html5-symbol-detail{oob_attr}>
<div class="panel-title">Символ</div>
<p class="muted padded">Выберите результат поиска для server-side definition/references по проекту {escape(project_id)}.</p>
</div>
@@ -1109,6 +1110,7 @@ def render_html5_symbol_detail(project_id: str, references: object | None) -> st
class="symbol-detail"
data-html5-symbol-detail
data-html5-lineage-id="{escape(lineage_id)}"
{oob_attr}
>
<div class="panel-title">Символ · {escape(str(kind))}</div>
<article class="symbol-focus">
+3 -1
View File
@@ -1768,6 +1768,7 @@ async def html5_project_object_context(project_id: str, object_name: str) -> Res
runtime = _runtime_for_object_context(project_id, impact)
knowledge = _knowledge_for_object_context(schema, impact, ui)
source_node = _source_node_for_object_context(project_id, impact)
symbol_references = await project_symbol_references(project_id, schema.object.lineage_id, direction="both")
object_context = render_html5_object_context(
project_id,
schema,
@@ -1782,8 +1783,9 @@ async def html5_project_object_context(project_id: str, object_name: str) -> Res
)
flowchart_context = render_html5_flowchart(project_id, flowchart, focus=object_name, oob=True)
source_context = render_html5_source(source_node, oob=True) if source_node is not None else ""
symbol_context = render_html5_symbol_detail(project_id, symbol_references, oob=True)
return Response(
object_context + flowchart_context + source_context,
object_context + flowchart_context + source_context + symbol_context,
media_type="text/html; charset=utf-8",
)