Slim embed tab rendering to cut memory use and restore calculator.
Load only per-tab data for embed fragments, skip exchange capital fetches on tab switches, and harden calculator market imports/timeouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from instance_embed_context_lib import embed_render_plan, trade_records_summary
|
||||
|
||||
|
||||
def test_embed_fragment_trade_is_light():
|
||||
plan = embed_render_plan("trade", "fragment")
|
||||
assert plan.exchange_capitals is False
|
||||
assert plan.records_rows is False
|
||||
assert plan.records_summary is False
|
||||
assert plan.orders is True
|
||||
assert plan.key_history is False
|
||||
|
||||
|
||||
def test_embed_shell_trade_summary_only():
|
||||
plan = embed_render_plan("trade", "shell")
|
||||
assert plan.exchange_capitals is True
|
||||
assert plan.records_summary is True
|
||||
assert plan.records_rows is False
|
||||
|
||||
|
||||
def test_embed_records_page_loads_rows():
|
||||
plan = embed_render_plan("records", "fragment")
|
||||
assert plan.records_rows is True
|
||||
|
||||
|
||||
def test_full_page_unchanged():
|
||||
plan = embed_render_plan("trade", None)
|
||||
assert plan.records_rows is True
|
||||
assert plan.exchange_capitals is True
|
||||
Reference in New Issue
Block a user