Skip to content

feat(List): add small prop, boxedDefaultPadding token and update divider alignment - #1677

Open
MurilloLeoni wants to merge 14 commits into
Telefonica:masterfrom
MurilloLeoni:feat/list-components-update
Open

feat(List): add small prop, boxedDefaultPadding token and update divider alignment#1677
MurilloLeoni wants to merge 14 commits into
Telefonica:masterfrom
MurilloLeoni:feat/list-components-update

Conversation

@MurilloLeoni

@MurilloLeoni MurilloLeoni commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This PR updates RowList and BoxedRowList.

Changes

Related

Spec

@MurilloLeoni
MurilloLeoni requested a review from a team as a code owner July 31, 2026 18:11
@Marcosld Marcosld added the safe-to-deploy Allow preview deploys in external PRs label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Label 'safe-to-deploy' added — dispatching fork preview workflow. Awaiting environment approval to expose deploy secrets.

@Marcosld Marcosld added safe-to-deploy Allow preview deploys in external PRs and removed safe-to-deploy Allow preview deploys in external PRs labels Aug 3, 2026
@brtbrt

brtbrt commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

I would have split into several PRs to ease focusing on the thing you're changing, and having a 1-1 relation with the subtasks

Telefonica/mistica-design#2675

@aweell aweell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should screenshot examples for small list variant be included?

@Marcosld Marcosld removed the safe-to-deploy Allow preview deploys in external PRs label Aug 3, 2026
@yceballost yceballost added the safe-to-deploy Allow preview deploys in external PRs label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🚀 Fork preview deploy triggered

The safe-to-deploy label was added and the fork preview workflow has been dispatched.

Important

A reviewer must approve the workflow run before it can access deploy secrets.
Open the run and click Review deployments to approve it.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Vercel Preview

Name Link
Preview https://mistica-k7qr50n1z-flows-projects-65bb050e.vercel.app

Comment thread src/list.tsx

const RowListDividerContext = React.createContext(false);

type ListContextType = {small: boolean};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure if we wanna introduce such a generic provider, or narrow it down to a specific small provider. have you considered it?

type ListCompactContextType = {small: boolean};
const ListCompactContext = React.createContext<ListCompactContextType>({small: false});

Comment thread src/list.tsx
))}
</div>
<ListContext.Provider value={{small}}>
<RowListDividerContext.Provider value>

@brtbrt brtbrt Aug 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is weird right? value should be at least true or false I think 🤔.
does @Telefonica/mistica-design agree with this behavior? showing/hiding the dividier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hi! setting it explicitly as value={true} actually breaks the react/jsx-boolean-value lint rule (screenshot attached), so the shorthand was the way to go here.

image

@brtbrt brtbrt Aug 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes but why do you wanna it in the first place? isn't the hideDivider enough? why the context, which is always true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make sense. I’m thinking of refactoring Content so it no longer reads RowListDividerContext directly and instead only receives a showDivider?: boolean prop.

RowContent would become the only place that consumes the context and computes the final value before passing it down. The divider condition in Content would then become much simpler:

{showDivider && (
    <div className={styles.rowDivider}>
        ...
    </div>
)}

This would keep the context usage contained in a single place and make the divider logic more explicit.

Wdyt?

@aweell

aweell commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@MurilloLeoni can you link to the spec of the list component with the updates?

Comment thread src/list.tsx
import type {DataAttributes, TrackingEvent, IconProps} from './utils/types';
import type {ExclusifyUnion} from './utils/utility-types';

const RowListDividerContext = React.createContext(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why have you introduced this provider? is the divider specification changing too? and actually, I see it always true (useless then?) + a weird branching

            {hasDivider && !hideDivider && (

on line 289. I don't know: can you explain it better?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the RowListDividerContext defaults to false, and only RowList sets it to true.

I introduced it so Content can know when it is being used inside a RowList. This replaces the previous approach where Divider elements were added manually between rows in RowList.

Components such as BoxedRowList use Content without this provider, so hasDivider stays false and no divider is rendered there.

The hasDivider && !hideDivider condition is needed for the dualAction layout (for example, a row with both onPress and a switch).

In that case, Content is rendered inside the BaseTouchable on the left side only. If the divider were rendered there, it would cover only the touchable area, not the full row including the control on the right. For that reason, hideDivider prevents the internal divider, and a separate divider is rendered below the whole row instead.

@MurilloLeoni

Copy link
Copy Markdown
Contributor Author

I would have split into several PRs to ease focusing on the thing you're changing, and having a 1-1 relation with the subtasks

Telefonica/mistica-design#2675

hii! Just to clarify, would you prefer that we split this current PR into several smaller ones, or is this more of a guideline to follow for the remaining subtasks and future PRs?

@MurilloLeoni

Copy link
Copy Markdown
Contributor Author

@MurilloLeoni can you link to the spec of the list component with the updates?

Sure! I’ll add the updated Lists specification link to the PR description and send here.
https://www.figma.com/design/Be8QB9onmHunKCCAkIBAVr/%F0%9F%94%B8-Lists-Specs?node-id=0-1

@brtbrt

brtbrt commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

hii! Just to clarify, would you prefer that we split this current PR into several smaller ones, or is this more of a guideline to follow for the remaining subtasks and future PRs?

no worries, just for the future!

Comment thread src/list.tsx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why boxedDefaultPadding is imported but never used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i checked the current src/list.tsx and I can’t find any boxedDefaultPadding import there. I think the comment may be referring to an older diff or another file.

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

Labels

safe-to-deploy Allow preview deploys in external PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants