feat(ui): gemini-style top-anchored scroll, centered chat layout and task drawer sync (closes #49)
This commit is contained in:
@@ -7,7 +7,7 @@ ROLE: Единый доменный сервис управления систе
|
||||
===============================================================================
|
||||
"""
|
||||
|
||||
from typing import Tuple, Dict, Any
|
||||
from typing import Tuple, Dict, Any, List, Optional
|
||||
from .repository import repo_get_active_prompt, repo_apply_prompt_action, repo_save_full_prompt
|
||||
from .diff_engine import build_prompt_diff
|
||||
|
||||
@@ -22,16 +22,28 @@ def apply_prompt_action(action: str, section_id: int, item_id: int, content: str
|
||||
repo_apply_prompt_action(action, section_id, item_id, content)
|
||||
|
||||
|
||||
def save_full_prompt_draft(draft_text: str) -> None:
|
||||
def save_full_prompt_draft(draft_text: str, prompt_name: str = "main_agent") -> None:
|
||||
"""Сохранить полный черновик промпта."""
|
||||
repo_save_full_prompt(draft_text)
|
||||
repo_save_full_prompt(draft_text, prompt_name=prompt_name)
|
||||
|
||||
|
||||
def create_prompt_preview(action: str, section_id: int, item_id: int, content: str = "") -> Tuple[str, str, str]:
|
||||
def create_prompt_preview(
|
||||
action: str,
|
||||
section_id: Optional[int] = None,
|
||||
item_id: Optional[int] = None,
|
||||
content: str = "",
|
||||
delete_nodes: Optional[List[Tuple[int, int]]] = None
|
||||
) -> Tuple[str, str, str]:
|
||||
"""
|
||||
Формирует черновик и diff.
|
||||
Возвращает (merged_draft, diff_html, baseline_prompt).
|
||||
"""
|
||||
baseline = repo_get_active_prompt()
|
||||
draft, diff_html = build_prompt_diff(action, section_id, item_id, content)
|
||||
draft, diff_html = build_prompt_diff(
|
||||
action=action,
|
||||
section_id=section_id,
|
||||
item_id=item_id,
|
||||
content=content,
|
||||
delete_nodes=delete_nodes
|
||||
)
|
||||
return draft, diff_html, baseline
|
||||
Reference in New Issue
Block a user