harden terminal view, add $impeccable design docs, update AGENTS.md
This commit is contained in:
parent
1089174264
commit
9644e9ceef
10 changed files with 1716 additions and 42 deletions
|
|
@ -46,6 +46,40 @@ a {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 12px;
|
||||
z-index: 40;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid rgba(255, 216, 154, 0.44);
|
||||
border-radius: 8px;
|
||||
background: rgba(7, 10, 14, 0.98);
|
||||
color: #ffe2aa;
|
||||
font-family: var(--font-mono), monospace;
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
transform: translateY(-160%);
|
||||
transition: transform 160ms ease;
|
||||
}
|
||||
|
||||
.skip-link:focus-visible {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
font: inherit;
|
||||
|
|
@ -88,10 +122,12 @@ input {
|
|||
}
|
||||
|
||||
.terminal-brand-name {
|
||||
min-width: 0;
|
||||
font-family: var(--font-display), sans-serif;
|
||||
font-size: 1.8rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.terminal-nav {
|
||||
|
|
@ -100,6 +136,8 @@ input {
|
|||
}
|
||||
|
||||
.terminal-nav-link {
|
||||
min-width: 0;
|
||||
min-height: 44px;
|
||||
padding: 12px 14px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 10px;
|
||||
|
|
@ -116,6 +154,13 @@ input {
|
|||
background: var(--bg-soft);
|
||||
}
|
||||
|
||||
.terminal-nav-link:focus-visible,
|
||||
.terminal-button:focus-visible,
|
||||
.instrument-focus-chip button:focus-visible {
|
||||
outline: 2px solid rgba(255, 216, 154, 0.88);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.terminal-nav-link-active {
|
||||
border-color: var(--border-strong);
|
||||
color: var(--text);
|
||||
|
|
@ -212,6 +257,7 @@ input {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
|
|
@ -222,6 +268,7 @@ input {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
flex: 0 1 auto;
|
||||
|
|
@ -335,6 +382,7 @@ input {
|
|||
.interval-button,
|
||||
.overlay-toggle,
|
||||
.drawer-close {
|
||||
min-height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 10px;
|
||||
|
|
@ -366,6 +414,7 @@ input {
|
|||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
min-height: 32px;
|
||||
max-width: min(360px, 32vw);
|
||||
padding: 5px 8px 5px 10px;
|
||||
|
|
@ -379,6 +428,7 @@ input {
|
|||
}
|
||||
|
||||
.instrument-focus-chip span {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
|
@ -1090,27 +1140,23 @@ h3 {
|
|||
}
|
||||
|
||||
.data-table-row-classified.is-classified {
|
||||
border-left: 3px solid rgba(var(--classifier-rgb), calc(0.35 + var(--classifier-intensity) * 0.45));
|
||||
padding-left: 7px;
|
||||
box-shadow: inset 0 0 0 1px rgba(var(--classifier-rgb), calc(0.28 + var(--classifier-intensity) * 0.24));
|
||||
}
|
||||
|
||||
.data-table-row-warn,
|
||||
.data-table-row-severity-high,
|
||||
.data-table-row-direction-bearish {
|
||||
border-left: 3px solid rgba(255, 107, 95, 0.58);
|
||||
padding-left: 7px;
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 107, 95, 0.46);
|
||||
}
|
||||
|
||||
.data-table-row-severity-medium,
|
||||
.data-table-row-direction-neutral {
|
||||
border-left: 3px solid rgba(77, 163, 255, 0.46);
|
||||
padding-left: 7px;
|
||||
box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.36);
|
||||
}
|
||||
|
||||
.data-table-row-severity-low,
|
||||
.data-table-row-direction-bullish {
|
||||
border-left: 3px solid rgba(37, 193, 122, 0.5);
|
||||
padding-left: 7px;
|
||||
box-shadow: inset 0 0 0 1px rgba(37, 193, 122, 0.38);
|
||||
}
|
||||
|
||||
.data-table-options .data-table-head,
|
||||
|
|
@ -1220,8 +1266,7 @@ h3 {
|
|||
|
||||
.options-table-row.is-classified {
|
||||
cursor: pointer;
|
||||
border-left: 3px solid rgba(var(--classifier-rgb), calc(0.35 + var(--classifier-intensity) * 0.45));
|
||||
padding-left: 7px;
|
||||
box-shadow: inset 0 0 0 1px rgba(var(--classifier-rgb), calc(0.28 + var(--classifier-intensity) * 0.24));
|
||||
}
|
||||
|
||||
.options-table-row > span {
|
||||
|
|
@ -1764,15 +1809,57 @@ h3 {
|
|||
}
|
||||
|
||||
.terminal-rail {
|
||||
position: static;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 35;
|
||||
height: auto;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(170px, auto) minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 14px 18px;
|
||||
padding: 14px 16px;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.terminal-brand {
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.terminal-brand-name {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.terminal-nav {
|
||||
display: flex;
|
||||
min-width: 0;
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.terminal-nav-link {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.shell-metrics {
|
||||
grid-column: 1 / -1;
|
||||
margin-top: 0;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
grid-template-columns: repeat(4, minmax(136px, 1fr));
|
||||
gap: 8px;
|
||||
overflow-x: auto;
|
||||
padding-bottom: 2px;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.shell-metric {
|
||||
min-width: 136px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.terminal-topbar {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1811,7 +1898,6 @@ h3 {
|
|||
}
|
||||
|
||||
.terminal-topbar {
|
||||
position: static;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 10px 16px;
|
||||
|
|
@ -1833,8 +1919,60 @@ h3 {
|
|||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.terminal-shell {
|
||||
background-size: 24px 24px, 24px 24px, 100% 100%, auto;
|
||||
}
|
||||
|
||||
.terminal-rail {
|
||||
position: static;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.terminal-brand {
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.terminal-brand-kicker {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.terminal-brand-name {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.terminal-nav {
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.terminal-nav-link {
|
||||
padding: 12px;
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
|
||||
.shell-metrics {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.shell-metric {
|
||||
flex: 0 0 156px;
|
||||
}
|
||||
|
||||
.terminal-content {
|
||||
padding: 18px 14px 22px;
|
||||
padding: 16px 10px 22px;
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 1.55rem;
|
||||
line-height: 1.06;
|
||||
}
|
||||
|
||||
.page-header,
|
||||
|
|
@ -1849,6 +1987,27 @@ h3 {
|
|||
.terminal-pane-title-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.terminal-topbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 30;
|
||||
padding: 12px 10px;
|
||||
}
|
||||
|
||||
.terminal-button,
|
||||
.mode-button,
|
||||
.filter-clear,
|
||||
.jump-button,
|
||||
.pause-button,
|
||||
.interval-button,
|
||||
.overlay-toggle,
|
||||
.drawer-close,
|
||||
.contract-filter-button,
|
||||
.filter-chip {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.terminal-topbar-actions,
|
||||
|
|
@ -1864,6 +2023,19 @@ h3 {
|
|||
align-items: stretch;
|
||||
}
|
||||
|
||||
.terminal-topbar-mode .terminal-button,
|
||||
.terminal-topbar-controls > .terminal-button,
|
||||
.page-actions > .terminal-button,
|
||||
.page-actions > .flow-filter-popover {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.instrument-focus-chip {
|
||||
max-width: none;
|
||||
min-height: 44px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.terminal-filter {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
|
@ -1873,10 +2045,46 @@ h3 {
|
|||
|
||||
.terminal-input {
|
||||
width: 100%;
|
||||
min-height: 38px;
|
||||
padding-bottom: 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.terminal-pane {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.terminal-pane-head,
|
||||
.terminal-pane-body {
|
||||
padding: 14px 12px;
|
||||
}
|
||||
|
||||
.terminal-pane-actions,
|
||||
.card-controls,
|
||||
.chart-controls,
|
||||
.tape-controls {
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.tape-controls button {
|
||||
flex: 1 1 112px;
|
||||
}
|
||||
|
||||
.status-inline {
|
||||
flex-wrap: wrap;
|
||||
row-gap: 4px;
|
||||
}
|
||||
|
||||
.status-inline-counter {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-actions {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.flow-filter-popover {
|
||||
|
|
@ -1890,11 +2098,13 @@ h3 {
|
|||
|
||||
.flow-filter-popover-panel {
|
||||
position: fixed;
|
||||
top: calc(var(--topbar-height) + 26px);
|
||||
left: 14px;
|
||||
right: 14px;
|
||||
top: auto;
|
||||
bottom: calc(10px + env(safe-area-inset-bottom));
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
width: auto;
|
||||
max-height: min(68vh, 560px);
|
||||
max-height: min(72vh, 560px);
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.flow-filter-checkbox-grid,
|
||||
|
|
@ -1908,6 +2118,39 @@ h3 {
|
|||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.data-table-wrap {
|
||||
margin-inline: -12px;
|
||||
border-radius: 0;
|
||||
scroll-snap-type: x proximity;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
min-width: 860px;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.data-table-options,
|
||||
.data-table-flow {
|
||||
min-width: 1080px;
|
||||
}
|
||||
|
||||
.data-table-head,
|
||||
.data-table-row {
|
||||
padding-inline: 8px;
|
||||
}
|
||||
|
||||
.data-table-row-options,
|
||||
.data-table-row-equities {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.data-table-row-flow,
|
||||
.data-table-row-alerts,
|
||||
.data-table-row-classifier,
|
||||
.data-table-row-dark {
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.time {
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -1917,10 +2160,31 @@ h3 {
|
|||
}
|
||||
|
||||
.drawer {
|
||||
position: static;
|
||||
position: fixed;
|
||||
inset: auto 10px calc(10px + env(safe-area-inset-bottom));
|
||||
width: auto;
|
||||
max-height: none;
|
||||
margin-top: 14px;
|
||||
max-height: min(78vh, 640px);
|
||||
margin-top: 0;
|
||||
border-radius: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.terminal-content {
|
||||
padding-inline: 8px;
|
||||
}
|
||||
|
||||
.terminal-pane-head,
|
||||
.terminal-pane-body {
|
||||
padding-inline: 10px;
|
||||
}
|
||||
|
||||
.shell-metric {
|
||||
flex-basis: 142px;
|
||||
}
|
||||
|
||||
.data-table-wrap {
|
||||
margin-inline: -10px;
|
||||
}
|
||||
|
||||
.synthetic-control-gear {
|
||||
|
|
|
|||
|
|
@ -27,8 +27,10 @@ import {
|
|||
getTapeVirtualConfig,
|
||||
mergeNewestWithOverflow,
|
||||
normalizeAlertSeverity,
|
||||
normalizeTickerFilterInput,
|
||||
nextFlowFilterPopoverState,
|
||||
isSyntheticAdminVisible,
|
||||
parseTickerFilterInput,
|
||||
prunePinnedEntries,
|
||||
projectPausableTapeState,
|
||||
reducePausableTapeData,
|
||||
|
|
@ -412,6 +414,17 @@ describe("synthetic admin visibility", () => {
|
|||
it("shows the internal control rail only when the public admin flag is enabled", () => {
|
||||
expect(isSyntheticAdminVisible("1")).toBe(true);
|
||||
expect(isSyntheticAdminVisible("0")).toBe(false);
|
||||
expect(isSyntheticAdminVisible(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("ticker filter helpers", () => {
|
||||
it("normalizes pasted ticker input into a stable terminal format", () => {
|
||||
expect(normalizeTickerFilterInput(" spy,\n nvda\u0000 aapl ")).toBe(" SPY, NVDA AAPL ");
|
||||
});
|
||||
|
||||
it("parses, uppercases, and deduplicates ticker tokens", () => {
|
||||
expect(parseTickerFilterInput("spy, nvda spy\nqqq")).toEqual(["SPY", "NVDA", "QQQ"]);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import {
|
|||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useId,
|
||||
useLayoutEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
|
|
@ -5054,6 +5055,25 @@ const formatFlowMetric = (value: number, suffix?: string): string => {
|
|||
return value.toLocaleString();
|
||||
};
|
||||
|
||||
const TICKER_FILTER_INPUT_MAX_LENGTH = 120;
|
||||
|
||||
export const normalizeTickerFilterInput = (value: string): string =>
|
||||
value
|
||||
.normalize("NFKC")
|
||||
.replace(/[\u0000-\u001f\u007f]+/g, " ")
|
||||
.replace(/,/g, ",")
|
||||
.replace(/\s+/g, " ")
|
||||
.toUpperCase()
|
||||
.slice(0, TICKER_FILTER_INPUT_MAX_LENGTH);
|
||||
|
||||
export const parseTickerFilterInput = (value: string): string[] => {
|
||||
const parts = normalizeTickerFilterInput(value)
|
||||
.split(/[,\s]+/)
|
||||
.map((part) => part.trim())
|
||||
.filter(Boolean);
|
||||
return Array.from(new Set(parts));
|
||||
};
|
||||
|
||||
const useTerminalState = () => {
|
||||
const pathname = usePathname();
|
||||
const routeFeatures = useMemo(() => getRouteFeatures(pathname), [pathname]);
|
||||
|
|
@ -5069,13 +5089,7 @@ const useTerminalState = () => {
|
|||
const [filterInput, setFilterInput] = useState<string>("");
|
||||
const [flowFilters, setFlowFilters] = useState<OptionFlowFilters>(() => buildDefaultFlowFilters());
|
||||
const [chartIntervalMs, setChartIntervalMs] = useState<number>(CANDLE_INTERVALS[0].ms);
|
||||
const activeTickers = useMemo(() => {
|
||||
const parts = filterInput
|
||||
.split(/[,\s]+/)
|
||||
.map((value) => value.trim().toUpperCase())
|
||||
.filter(Boolean);
|
||||
return Array.from(new Set(parts));
|
||||
}, [filterInput]);
|
||||
const activeTickers = useMemo(() => parseTickerFilterInput(filterInput), [filterInput]);
|
||||
const tickerSet = useMemo(() => new Set(activeTickers), [activeTickers]);
|
||||
const instrumentUnderlying = selectedInstrument?.underlyingId.toUpperCase() ?? null;
|
||||
const isOptionContractFocused = selectedInstrument?.kind === "option-contract";
|
||||
|
|
@ -8348,20 +8362,26 @@ function SyntheticControlDock() {
|
|||
export function TerminalAppShell({ children }: { children: ReactNode }) {
|
||||
const state = useTerminalState();
|
||||
const pathname = usePathname();
|
||||
const tickerFieldId = useId();
|
||||
const tickerHintId = useId();
|
||||
|
||||
return (
|
||||
<TerminalContext.Provider value={state}>
|
||||
<div className="terminal-shell">
|
||||
<a className="skip-link" href="#terminal-content">
|
||||
Skip to terminal content
|
||||
</a>
|
||||
<aside className="terminal-rail">
|
||||
<div className="terminal-brand">
|
||||
<span className="terminal-brand-kicker">IF</span>
|
||||
<span className="terminal-brand-name">Islandflow</span>
|
||||
</div>
|
||||
<nav className="terminal-nav">
|
||||
<nav aria-label="Primary" className="terminal-nav">
|
||||
{NAV_ITEMS.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
return (
|
||||
<Link
|
||||
aria-current={active ? "page" : undefined}
|
||||
className={`terminal-nav-link${active ? " terminal-nav-link-active" : ""}`}
|
||||
href={item.href}
|
||||
key={item.href}
|
||||
|
|
@ -8387,31 +8407,46 @@ export function TerminalAppShell({ children }: { children: ReactNode }) {
|
|||
</span>
|
||||
) : null}
|
||||
<label className="terminal-filter">
|
||||
<span className="terminal-filter-label">Ticker</span>
|
||||
<span className="terminal-filter-label" id={tickerHintId}>
|
||||
Ticker
|
||||
</span>
|
||||
<span className="terminal-filter-field">
|
||||
<input
|
||||
id={tickerFieldId}
|
||||
aria-describedby={tickerHintId}
|
||||
autoCapitalize="characters"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
className="terminal-input"
|
||||
value={state.filterInput}
|
||||
onChange={(event) => state.setFilterInput(event.target.value)}
|
||||
inputMode="text"
|
||||
maxLength={TICKER_FILTER_INPUT_MAX_LENGTH}
|
||||
name="ticker-filter"
|
||||
onChange={(event) => state.setFilterInput(normalizeTickerFilterInput(event.target.value))}
|
||||
placeholder="SPY, NVDA, AAPL"
|
||||
spellCheck={false}
|
||||
/>
|
||||
</span>
|
||||
</label>
|
||||
<button
|
||||
aria-label="Clear ticker filter"
|
||||
className="terminal-button"
|
||||
type="button"
|
||||
onClick={() => state.setFilterInput("")}
|
||||
disabled={state.filterInput.trim().length === 0}
|
||||
title="Clear ticker filter"
|
||||
>
|
||||
Clear
|
||||
</button>
|
||||
</div>
|
||||
<div className="terminal-topbar-mode">
|
||||
<button
|
||||
aria-label={state.mode === "live" ? "Switch to replay mode" : "Switch to live mode"}
|
||||
aria-pressed={state.mode !== "live"}
|
||||
className="terminal-button terminal-button-primary"
|
||||
type="button"
|
||||
onClick={state.toggleMode}
|
||||
title={state.mode === "live" ? "Switch to replay mode" : "Switch to live mode"}
|
||||
>
|
||||
{state.mode === "live" ? "Replay" : "Live"}
|
||||
</button>
|
||||
|
|
@ -8419,7 +8454,9 @@ export function TerminalAppShell({ children }: { children: ReactNode }) {
|
|||
</div>
|
||||
</header>
|
||||
|
||||
<main className="terminal-content">{children}</main>
|
||||
<main className="terminal-content" id="terminal-content">
|
||||
{children}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<SyntheticControlDock />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue