Skip to content

feat(react-navigation-plugin): add a navigation state visualizer#119

Merged
V3RON merged 6 commits intocallstackincubator:mainfrom
thomasrebam:feat/add-navigation-tree
Oct 23, 2025
Merged

feat(react-navigation-plugin): add a navigation state visualizer#119
V3RON merged 6 commits intocallstackincubator:mainfrom
thomasrebam:feat/add-navigation-tree

Conversation

@thomasrebam
Copy link
Copy Markdown
Contributor

Add a navigation state visualizer

The goal of this feature is to improve state visualization, as JSON visualization can be unclear and does not show history evolutions. This window already exists in our fork of the react-navigation expo dev plugin.
I think representing the navigation state as a stack helps grasping the effects of navigations events, in particular native go-backs.

Features

  • New 'Navigation Tree' tab
  • Representation of the navigation state as a stack of screens, navigators, and tab navigators
  • Display of the navigation history as a succession of states
  • Distinction of screens and navigators through colors
  • Display of selected screen in tab navigator

Demo

Enregistrement.de.l.ecran.2025-10-02.a.19.31.07.mov

Future ideas

I added here the base of what was done in our plugin, but a few more things could be added, such as:

  • Add a button to download the whole history (or part of it)
  • Add display of screen parameters (useful for apps that display screens with the same name but different parameters)
  • Integration with the Action Timeline

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 2, 2025

@thomasrebam is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

cursor[bot]

This comment was marked as outdated.

@thomasrebam thomasrebam force-pushed the feat/add-navigation-tree branch from f7eca41 to 11e0233 Compare October 2, 2025 17:59
cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@V3RON V3RON left a comment

Choose a reason for hiding this comment

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

Woah, this looks like a really useful tool and a great addition to this plugin 👏
I left a couple of small comments regarding potential improvements. Let me know what you think.

Comment on lines +5 to +7
type Props = {
actionHistory: ActionWithState[];
};
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.

Suggested change
type Props = {
actionHistory: ActionWithState[];
};
export type NavigationTreeProps = {
actionHistory: ActionWithState[];
};

<div
className={`items-stretch flex flex-col rounded-sm cursor-pointer bg-transparent border-2 border-solid p-1 text-center border-${color}-600 ${
isClosed ? '' : 'border-t-0 rounded-t-none'
} hover:bg-${color}-600 hover:bg-opacity-30`}
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.

Right now, if you hover over one of the states, all nodes trigger their 'hover' states. Should we change it so that if you hover over 'BottomTabs', only it and its children are highlighted?

Screenshot 2025-10-03 at 13 32 56

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.

Yes, sure!

I did not manage to find a nice solution with tailwind and pseudo-selectors, so I used mouse events directly, but I changed the behavior so parent nodes are not hovered if their children are.

onClick: (e: React.MouseEvent<HTMLDivElement>) => void;
}) => {
return (
<div
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.

Let's use buttons, as divs are not meant to be clickable.

@thomasrebam
Copy link
Copy Markdown
Contributor Author

Hey, @V3RON
Do the changes look ok to you? If needed I can bring modifications!

@V3RON
Copy link
Copy Markdown
Contributor

V3RON commented Oct 14, 2025

Hey @thomasrebam 👋
Sorry for the delay. I've been in the U.S. for React Conf over the past week. I've just tested it again, and it looks great. I'm going to push version plan and have it merged.

Thanks for the contribution 🎉

@V3RON V3RON self-requested a review October 14, 2025 11:36
@V3RON V3RON merged commit 74772d7 into callstackincubator:main Oct 23, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants