Skip to content

feat: simple ui#2059

Open
pp346 wants to merge 35 commits intomainfrom
feat/simpleui
Open

feat: simple ui#2059
pp346 wants to merge 35 commits intomainfrom
feat/simpleui

Conversation

@pp346
Copy link
Contributor

@pp346 pp346 commented Jan 27, 2026

Changes

Issue

https://linear.app/dydx/issue/ENG-1185/revert-simple-ui-from-mobile-web

Related Issues (Optional)

Screenshots/Recordings (Optional)

@pp346 pp346 requested a review from a team as a code owner January 27, 2026 14:35
@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v4-staging Ready Ready Preview, Comment Feb 11, 2026 2:59pm
v4-testnet Ready Ready Preview, Comment Feb 11, 2026 2:59pm

Request Review

const fieldStates = getTradeFormFieldStates(state, accountData, baseAccount);

const effectiveTrade = mapValues(fieldStates, (s) => s.effectiveValue) as TradeForm;
const effectiveTrade = mapValues(fieldStates, (s) => s?.effectiveValue) as TradeForm;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need the ?. This is because you are using ?: boolean instead of : boolean | undefined

}, []);

return {
marketId: validId,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need to be returned? Can access from redux right?

const {
type: selectedTradeType,
side = OrderSide.BUY,
// isClosingPosition,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +109 to +111
// if (isClosingPosition === true) {
// return;
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

tw="w-full"
/>

{useLimit && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but strays from how we consume the Trade form state.

const { showLimitPrice, showTriggerPrice } = tradeSummary.options;

This is why we have the makeVisible function

Comment on lines +61 to +63
{/* <DetachedSection>
<MobileBottomPanel />
</DetachedSection> */}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

size={ButtonSize.Medium}
onClick={() => {
navigate(`${AppRoute.TradeForm}`);
dispatch(tradeFormActions.setIsClosingPosition(false));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think always having to set this is actually lends support to us moving away from having it as a field type

size={ButtonSize.Medium}
onClick={() => {
navigate(`${AppRoute.TradeForm}`);
dispatch(tradeFormActions.setIsClosingPosition(false));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

reduceOnly,
marginMode = MarginMode.CROSS,
side = OrderSide.BUY,
// isClosingPosition,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +130 to +132
// if (isClosingPosition === true) {
// return;
// }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

/>
</Button>
</div>
<div tw="flex w-full gap-0.25 rounded-[0.5em] bg-[#181819] p-[4px]">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoded bg color and px instead of rem

</DropdownMenuTrigger>
</MobileDropdownMenu>
<AvailableRow>
<AvailableLabel> Available </AvailableLabel>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STRING_KEYS.AVAILABLE is available

<TradeSizeInputs />
</$InputsColumn>
<ToggleRow>
<ToggleLabel>Triggers</ToggleLabel>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STRING_KEYS.TRIGGERS

Comment on lines 383 to 430
const AvailableRow = styled.div`
display: flex;

justify-content: space-between;

align-items: center;

padding: 8 px 4 px;

margin-bottom: 8 px;

width: 100%;
`;
const AvailableLabel = styled.span`
color: #6b7280;

font-size: 15 px;
`;
const AvailableValue = styled.div`
display: flex;

align-items: center;

gap: 8 px;

color: #6b7280;

font-size: 15 px;
`;

const ToggleRow = styled.div`
display: flex;

justify-content: space-between;

align-items: center;

padding: 0px 0px;

width: 100%;
`;
const ToggleLabel = styled.span`
color: #9ca3af;

font-size: 16 px;

font-weight: 400;
`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we fix this to not use hardcoded colors and to use rem isntead of px

content: <TvChart />,
forceMount: true,
label: stringGetter({ key: STRING_KEYS.PRICE }),
label: 'Chart', // stringGetter({ key: STRING_KEYS.CHART }),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a TODO here. We can add Chart as soon as npm package ownership changes

align="end"
tw="z-1"
items={sortItems}
slotTop={<span tw="text-color-text-0 font-small-book">Sort by</span>}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STRING_KEYS.SORT_BY

Comment on lines +188 to +190
thead {
--stickyArea-totalInsetTop: 0;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something we want on both desktop and mobile?

gap: 0.25em;
width: var(--output-width);

${({ $isTablet }) => ($isTablet ? `` : 'width: var(--output-width); display: inline-flex;')}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use a @media query instead of passing isTablet

Comment on lines +238 to 240
${({ $isTablet }) =>
`${$isTablet ? '--output-width: 30px; gap: 0.25em;' : '--output-width: 70px; gap: 0.75em; justify-content: center;'}`}
`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same. Can use @media query here

</div>
<div tw="flex flex-[0.6] flex-col gap-0.125">
<Button
tw="h-[34px] rounded-[8px] border-none bg-color-border-red px-1 text-mini text-red"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

px->rem?

tw="h-[34px] rounded-[8px] border-none bg-color-border-red px-1 text-mini text-red"
onClick={() => onCloseButtonToggle(position.market)}
>
<Icon iconName={IconName.Close} size="12px" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

px->rem?

onClick={() => onCloseButtonToggle(position.market)}
>
<Icon iconName={IconName.Close} size="12px" />
Close
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localize

`;

const $Actions = styled.footer`
const $Actions = styled.div`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't quite understand this change.

I also don't think we use <PositionInfo> anywhere.

{showMobileWeb ? <FooterMobile /> : <FooterDesktop />}

<NotificationsToastArea tw="z-[2] [grid-area:Main]" />
<NotificationsToastArea tw="z-[2000] [grid-area:Main]" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be fine. but I think we need to have some reasoning or consistency behind assigning z-index to items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants