Skip to content

Add web/native tabs and search hook#1

Open
EvanBacon wants to merge 1 commit intomainfrom
@evanbacon/add-back-tabs
Open

Add web/native tabs and search hook#1
EvanBacon wants to merge 1 commit intomainfrom
@evanbacon/add-back-tabs

Conversation

@EvanBacon
Copy link
Copy Markdown
Contributor

  • Make it a bit easier for agent to understand the default structure of tabs / stack and how to use tabs.
  • This adds an extra search screen which is hidden by default so the agent can decide to enable it or not. The screen helps indicate how multiple tabs with shared routes should work.

Introduce a platform-aware tab layout and a search feature: move index into a new (index,search) route group, add a temporary group layout and a search screen, and update the root _layout to render WebTabs on web and NativeTabs on native (with icons and hidden/search-specific behavior). Add use-search hook to manage the header search bar state and callbacks (returns the current query). Files added/changed: new (index,search)/_layout.tsx, (index,search)/search.tsx, src/hooks/use-search.tsx; index.tsx renamed into the new group; src/app/_layout.tsx updated to use ThemeProvider with conditional tab implementations.
Comment thread src/hooks/use-search.tsx
const navigation = useNavigation();
useEffect(() => {
navigation.setOptions({
headerShown: true,
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.

Is this iOS limitation? With the liquid glass the top bar shows and hides funny when interacting with the search.

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.

Actually it's just the template where it looks a bit strange, in apps with content it's good.

Comment thread src/app/_layout.tsx
@krystofwoldrich
Copy link
Copy Markdown
Contributor

It's unfortunate that the initial screen won't be clean without the tabs, but I think it's worth it to avoid issues with the tabs impl by the agent.

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