diff --git a/e2e/binance-orderbook/specs/control-flows.pw.js b/e2e/binance-orderbook/specs/control-flows.pw.js index 10aabf8..cc23c7a 100644 --- a/e2e/binance-orderbook/specs/control-flows.pw.js +++ b/e2e/binance-orderbook/specs/control-flows.pw.js @@ -99,16 +99,24 @@ test('starting a ladder disables every start action and exposes one stop control const panel = page.locator(PANEL_SELECTOR); const startLong = panel.getByRole('button', { name: '阶梯开多' }); const startShort = panel.getByRole('button', { name: '阶梯开空' }); + const cancel = panel.getByRole('button', { name: '撤单' }); const stop = panel.getByRole('button', { name: '停止阶梯挂单' }); await expect(startLong).toBeEnabled(); await expect(startShort).toBeEnabled(); await expect(stop).toHaveCount(0); + const startLongRect = await readRect(startLong); + const startShortRect = await readRect(startShort); + const cancelRect = await readRect(cancel); await installInteractionProbe(page, '[data-ladder-action="OPEN_LONG"]'); await startLong.click(); await expect(startLong).toHaveCount(0); await expect(startShort).toHaveCount(0); await expect(stop).toBeEnabled(); + const stopRect = await readRect(stop); + expect(stopRect.x).toBe(startLongRect.x); + expect(stopRect.x + stopRect.width).toBe(startShortRect.x + startShortRect.width); + expect(await readRect(cancel)).toEqual(cancelRect); const submissionsBeforeStop = (await readFixtureState(page)).events .filter((event) => event.type === 'order-submitted').length; await stop.click(); diff --git a/scripts/binance-orderbook-trade.user.js b/scripts/binance-orderbook-trade.user.js index 5201afb..70e29dd 100644 --- a/scripts/binance-orderbook-trade.user.js +++ b/scripts/binance-orderbook-trade.user.js @@ -3,7 +3,7 @@ // @namespace binance.orderbook.trade // @icon data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E // @icon64 data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E -// @version 2.7.121 +// @version 2.7.122 // @author jackhai9 // @description 单击订单簿价格,按当前开仓/平仓 tab 自动填数量并执行下单,内置数量倍率面板 // @match https://www.binance.com/*/futures/* @@ -5649,12 +5649,11 @@ noOrdersFeedback: cancelNoOrdersFeedbackActive }); const controlSections = getLadderControlSections(mode, closeContext, symbol, precision); - const primaryActions = ladderRunning ? [``] : controlSections.actionButtons; - const actionColumnCount = Math.max(1, primaryActions.length + 1); + const primaryActions = ladderRunning ? [``] : controlSections.actionButtons; const bodyHtml = [ ...controlSections.optionRows, `
`, - `