fix(web): global layout fixes for overlap, clipping, responsive reflow

Adds web/src/layout-fixes.css imported once from main.tsx — surgical
overrides applied with !important so they win against the existing
3000+ line index.css without rewriting it.

Issues fixed:
1. Modals/popovers/dropdowns clipped by .dashboard-main { overflow: hidden }
   → now overflow: visible. Stacking context guard for [role=dialog].
2. Right panel (308px fixed) covers main content on laptop/tablet
   → 260px below 1280px, hidden below 1024px.
3. Tables extending off-screen
   → .dashboard-content table wrapped with display:block + overflow-x:auto
   so they scroll inside their column. Also exposes .scroll-x utility.
4. Header search/indices push each other off-screen
   → flex-wrap on .trading-header, search shrinks to 240–360px range,
   indices wrap with smaller column gap on narrow.
5. Long unbreakable strings (commit SHAs, URLs) escaping containers
   → overflow-wrap: anywhere + word-break: break-word + pre-wrap on <pre>.
6. Sidebar 76px doesn't collapse on mobile
   → 56px below 768px with reduced content padding.

Bumps @bytelyst/devops to ^0.1.3 (responsive panel) in backend + web.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
root 2026-05-10 07:14:50 +00:00
parent bd762d32a9
commit f463ff64de
4 changed files with 152 additions and 2 deletions

View File

@ -77,7 +77,7 @@
"socket.io": "^4.8.3", "socket.io": "^4.8.3",
"winston": "^3.19.0", "winston": "^3.19.0",
"@bytelyst/telemetry-client": "*", "@bytelyst/telemetry-client": "*",
"@bytelyst/devops": "^0.1.2" "@bytelyst/devops": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^25.0.3", "@types/node": "^25.0.3",

View File

@ -42,7 +42,7 @@
"react-router-dom": "^7.14.2", "react-router-dom": "^7.14.2",
"recharts": "^3.6.0", "recharts": "^3.6.0",
"socket.io-client": "^4.8.3", "socket.io-client": "^4.8.3",
"@bytelyst/devops": "^0.1.2" "@bytelyst/devops": "^0.1.3"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.4",

149
web/src/layout-fixes.css Normal file
View File

@ -0,0 +1,149 @@
/* ============================================================================
* Layout fixes global overrides for known overflow / responsiveness issues.
*
* Applied as a separate file so individual fixes are easy to review and revert.
* Imported once from main.tsx after the main index.css.
* ============================================================================ */
/* --------------------------------------------------------------------------
* 1. Don't clip popovers / modals / dropdowns to the main area.
* Allow horizontal clipping (prevents accidental page-wide scroll) but
* keep vertical visible so absolute-positioned UI escapes the row.
* -------------------------------------------------------------------------- */
.dashboard-main {
overflow: visible !important;
}
.dashboard-content-row {
overflow: visible !important;
}
.dashboard-content {
/* Vertical scroll stays. Horizontal overflow becomes a child concern,
not a layout-level concern, so wide tables can scroll inside their
own container instead of being silently clipped. */
overflow-x: clip;
}
/* --------------------------------------------------------------------------
* 2. Collapse the right panel on narrower viewports.
* 308px is too greedy below ~1280px and steals critical content width.
* Below 1024px it's hidden entirely (mobile/tablet view).
* -------------------------------------------------------------------------- */
@media (max-width: 1279px) {
.dashboard-right-panel,
.right-panel {
width: 260px;
min-width: 260px;
max-width: 260px;
}
}
@media (max-width: 1023px) {
.dashboard-right-panel,
.right-panel {
display: none !important;
}
}
/* --------------------------------------------------------------------------
* 3. Tables and large grids must scroll within their own container.
* Any table that's a direct child of dashboard-content should never
* push the layout horizontally wrap consumers can opt-in via
* .scroll-x to the same behavior.
* -------------------------------------------------------------------------- */
.dashboard-content table:not(.no-scroll-fix),
.scroll-x {
display: block;
max-width: 100%;
overflow-x: auto;
}
/* Preserve table semantics inside the scroll container */
.dashboard-content table:not(.no-scroll-fix) > thead,
.dashboard-content table:not(.no-scroll-fix) > tbody,
.dashboard-content table:not(.no-scroll-fix) > tfoot {
display: table-row-group;
}
.dashboard-content table:not(.no-scroll-fix) > thead {
display: table-header-group;
}
/* --------------------------------------------------------------------------
* 4. Header should reflow on narrow viewports.
* The fixed 300px search and three indices push each other off-screen
* on laptop widths (~1366px) once the right panel is also showing.
* -------------------------------------------------------------------------- */
.trading-header {
flex-wrap: wrap;
row-gap: 8px;
min-height: 56px;
height: auto !important;
}
.trading-header-search {
flex: 1 1 240px;
min-width: 0;
max-width: 360px;
}
.trading-header-indices {
flex-wrap: wrap;
row-gap: 6px;
column-gap: 20px !important;
}
@media (max-width: 760px) {
.trading-header-indices {
column-gap: 14px !important;
}
.trading-header-indices > div > div:first-child {
font-size: 10px;
}
}
/* --------------------------------------------------------------------------
* 5. Sidebar collapse on narrow viewports.
* The fixed 76px sidebar plus margin-left compounds with content
* overflow on small windows. Below 768px we collapse it to 56px.
* -------------------------------------------------------------------------- */
@media (max-width: 767px) {
:root {
--trading-shell-sidebar-width: 56px;
}
.trading-sidebar {
width: 56px;
}
.dashboard-content {
padding: 16px 16px 24px !important;
}
}
/* --------------------------------------------------------------------------
* 6. Container guard content never exceeds its column.
* Long unbreakable strings (commit SHAs, URLs) that escape boxes are a
* common source of "elements pushed off-screen". This forces wrap.
* -------------------------------------------------------------------------- */
.dashboard-content,
.dashboard-content code,
.dashboard-content pre,
.dashboard-content .ux-surface {
overflow-wrap: anywhere;
word-break: break-word;
}
.dashboard-content pre {
white-space: pre-wrap;
}
/* --------------------------------------------------------------------------
* 7. Modal / dialog z-index baseline.
* Anything inside .dashboard-content-row that was clipped by the
* overflow:hidden fix in (1) now needs a stacking context guard.
* -------------------------------------------------------------------------- */
[role="dialog"],
.modal,
[data-radix-popper-content-wrapper] {
z-index: 100;
}

View File

@ -3,6 +3,7 @@ import { createRoot } from 'react-dom/client'
import { Agentation } from 'agentation' import { Agentation } from 'agentation'
import './index.css' import './index.css'
import './App.css' import './App.css'
import './layout-fixes.css'
import App from './App.tsx' import App from './App.tsx'
import { AuthProvider } from './components/AuthContext'; import { AuthProvider } from './components/AuthContext';
import { ProductAccessibilityGate } from './components/ProductAccessibilityGate'; import { ProductAccessibilityGate } from './components/ProductAccessibilityGate';