agent-Specialization/server/app.py
JOJO d60808923f fix: 修复堆叠块在折叠状态下全局鬼畜与容器动画不同步
根因(双重修复):
1. 容器高度计算改为精确目标高度公式 overhead + contentTarget,替代受CSS过渡
   影响的实时高度测量,消除 JS测量↔CSS过渡 的循环反馈
2. 给容器添加260ms CSS过渡(与块内容max-height过渡同duration/easing),
   用CSS统一负责所有动画,替代之前逐帧rAF追踪的视觉不同步
3. scrollListener中检测到scrollHeight变化时强制延长suppressUserIntentUntil
   至400ms,防止stick-to-bottom spring的自动追底被误判为用户滚动而中断

配套清理:移除调试日志代码和临时/api/debug/stacked-log端点
2026-06-08 02:08:43 +08:00

53 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""统一入口:复用 app_legacy便于逐步替换/收敛。"""
import argparse
import os
import json
from datetime import datetime
from flask import request
from .app_legacy import (
app,
socketio,
run_server as _run_server,
parse_arguments as _parse_arguments,
initialize_system,
resource_busy_page,
DEFAULT_PORT,
)
def parse_arguments():
"""向后兼容的参数解析,默认端口、路径等与 app_legacy 一致。"""
return _parse_arguments()
def run_server(path: str, thinking_mode: bool = False, port: int = DEFAULT_PORT, debug: bool = False):
"""统一 run_server 入口,便于 future 替换实现。"""
return _run_server(path=path, thinking_mode=thinking_mode, port=port, debug=debug)
def main():
args = parse_arguments()
run_server(
path=args.path,
thinking_mode=args.thinking_mode,
port=args.port,
debug=args.debug,
)
__all__ = [
"app",
"socketio",
"run_server",
"parse_arguments",
"initialize_system",
"resource_busy_page",
"main",
"DEFAULT_PORT",
]
if __name__ == "__main__":
main()