Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Untitled.jpg
Binary file not shown.
24 changes: 0 additions & 24 deletions backend/test_ui.py

This file was deleted.

2 changes: 1 addition & 1 deletion backend/ui/static/js/oiTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ const OiTool = {
renderSingleChart: function(container, data) {
container.innerHTML = '';

const history = data.history || [];
const history = (data.history || []).slice().reverse(); // Reverse so latest is last in array
const x = history.map(d => d.oi_chg_pct);
const y = history.map(d => d.price_chg_pct);
const text = history.map(d => `${d.time}<br>${d.interpretation}`);
Expand Down
17 changes: 11 additions & 6 deletions backend/ui/static/js/script_workbench2.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@
// Re-render ECharts or resize them since they might have collapsed while hidden
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
if (typeof volConeChart !== 'undefined' && volConeChart) volConeChart.resize();
if (typeof volPreExpiryChart !== 'undefined' && volPreExpiryChart) volPreExpiryChart.resize();
if (window.volConeChart) window.volConeChart.resize();
if (window.volPreExpiryChart) window.volPreExpiryChart.resize();
}, 50);
}, 200);
}
}

Expand Down Expand Up @@ -3153,11 +3155,14 @@ async function triggerMasterSync() {
// Clear main UI Matrix (from previous logic)
if (typeof clearMatrixUI === 'function') clearMatrixUI();

// NIFTY Data preload for UI
if (typeof loadTimeseriesData === 'function') {
document.getElementById('symbol-input').value = 'NIFTY';
promises.push(loadTimeseriesData().catch(e => console.error("loadTimeseriesData failed", e)));
}
// Data Matrix (Load Timeseries / Snapshot view for Data Matrix)
if (typeof loadTimeseriesData === 'function') promises.push(loadTimeseriesData(true).catch(e => console.error("loadTimeseriesData failed", e)));

// Options Chain
if (typeof loadOptionChain === 'function') promises.push(loadOptionChain().catch(e => console.error("loadOptionChain failed", e)));

// Market Activity / Macro & Events (loadMarketOptionsCharts usually triggers market activity charts)
if (typeof loadMarketOptionsCharts === 'function') promises.push(loadMarketOptionsCharts().catch(e => console.error("loadMarketOptionsCharts failed", e)));

// Wait for all to finish concurrently
await Promise.allSettled(promises);
Expand Down
158 changes: 125 additions & 33 deletions backend/ui/static/js/specialSitTool.js

Large diffs are not rendered by default.

64 changes: 43 additions & 21 deletions backend/ui/templates/workbench.html

Large diffs are not rendered by default.

Binary file removed jules_session_5003129757467130338.zip
Binary file not shown.
7 changes: 0 additions & 7 deletions test_buyback.py

This file was deleted.

39 changes: 0 additions & 39 deletions test_charts.html

This file was deleted.

33 changes: 33 additions & 0 deletions test_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from playwright.sync_api import sync_playwright

def run_test(page):
page.goto("http://localhost:8000/workbench")
page.wait_for_timeout(2000)

# Check Master Sync
page.get_by_role("button", name="Master Sync").click()
page.wait_for_timeout(2000)

# Check Volatility Cone Layout (switch to Deriv -> Vol Analysis)
page.evaluate("switchMainTab('derivatives')")
page.wait_for_timeout(1000)
page.evaluate("switchDerivTab('optanalysis')")
page.wait_for_timeout(1000)

# Screenshot the Vol Analysis view
page.screenshot(path="/home/jules/verification/screenshots/verification.png", full_page=True)
page.wait_for_timeout(1000)

if __name__ == "__main__":
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context(
record_video_dir="/home/jules/verification/videos",
viewport={'width': 1920, 'height': 1080}
)
page = context.new_page()
try:
run_test(page)
finally:
context.close()
browser.close()
27 changes: 27 additions & 0 deletions test_ui2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from playwright.sync_api import sync_playwright

def run_test(page):
page.goto("http://localhost:8000/workbench")
page.wait_for_timeout(2000)

# Check Special Situation Arb tabs order
page.evaluate("switchMainTab('special_arb')")
page.wait_for_timeout(1000)

# Screenshot the Special Situation Arb view
page.screenshot(path="/home/jules/verification/screenshots/verification2.png", full_page=True)
page.wait_for_timeout(1000)

if __name__ == "__main__":
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context(
record_video_dir="/home/jules/verification/videos",
viewport={'width': 1920, 'height': 1080}
)
page = context.new_page()
try:
run_test(page)
finally:
context.close()
browser.close()
36 changes: 36 additions & 0 deletions test_ui3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from playwright.sync_api import sync_playwright

def run_test(page):
page.goto("http://localhost:8000/workbench")
page.wait_for_timeout(2000)

# Check Special Situation Arb tabs order
page.evaluate("switchMainTab('special_arb')")
page.wait_for_timeout(1000)
page.evaluate("switchSpecialSitTab('buyback')")
page.wait_for_timeout(1000)

# Input some negative value for profit to verify it's red
page.evaluate("document.getElementById('bb-cmp').value = '150';")
page.evaluate("document.getElementById('bb-fut-price').value = '100';")
page.evaluate("document.getElementById('bb-shares-calc').value = '100';")
page.evaluate("calculateBuyback();")
page.wait_for_timeout(1000)

# Screenshot the Buyback view
page.screenshot(path="/home/jules/verification/screenshots/verification3.png", full_page=True)
page.wait_for_timeout(1000)

if __name__ == "__main__":
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context(
record_video_dir="/home/jules/verification/videos",
viewport={'width': 1920, 'height': 1080}
)
page = context.new_page()
try:
run_test(page)
finally:
context.close()
browser.close()
27 changes: 27 additions & 0 deletions test_ui4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from playwright.sync_api import sync_playwright

def run_test(page):
page.goto("http://localhost:8000/workbench")
page.wait_for_timeout(2000)

# Check Special Situation Arb tabs order
page.evaluate("switchMainTab('history')")
page.wait_for_timeout(1000)

# Screenshot the History view
page.screenshot(path="/home/jules/verification/screenshots/verification4.png", full_page=True)
page.wait_for_timeout(1000)

if __name__ == "__main__":
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
context = browser.new_context(
record_video_dir="/home/jules/verification/videos",
viewport={'width': 1920, 'height': 1080}
)
page = context.new_page()
try:
run_test(page)
finally:
context.close()
browser.close()
3 changes: 0 additions & 3 deletions test_weasyprint.py

This file was deleted.

Loading