F NAV - Mobile Navigation Tabs

Install this theme component

Hello :wave:

Before, I have created a Dev topic for it as a theme component concept and now this is in a state to be a Theme component.

:warning: Please be sure to test it before use in live.

Some info here about the component: F NAV - Theme component concept


About the theme component. I was read so much posts about it would be wonderful to make the Discourse Tab Bar for Mobile more dynamic and add the ability to handle e.g. notifications etc… F-NAV can do this and more…

Header

It hides the hamburger, user menu, search and chat and adds a profile (avatar) menu button which contains the default user menu profile tab content.

Settings

It also contains a setting where you can add custom items before Log Out item.
It contains three fields where you can easily add custom items.

There are some settings for show/hide the default header icons which is useful when you don’t want to place the exact tab in F NAV so it will shown on header.

Tabs

It is possible to associate different functions with tabs. These functions allow each tab to change dynamically.

Screenshot 2024-12-13 at 13.06.14

Such changes include:

Functions

home

  • switches the home tab icon on topic routes to left arrow which add a go back function
    Screenshot 2024-12-13 at 12.29.33
  • adds new or unread topic indicator dot
    Screenshot 2024-12-13 at 12.30.52

hamburger (opens the hamburger menu)


multi

multi tab

Multi tab is change automatically to message tab if chat is not enabled or user turn it off in
user settings.

The notifications bubble changes as it is urgent or not.

Multi tab urgent notifications are green and looks like this. :arrow_down_small:


Expanded

Personal message is always green but chat can be blue as originally for example unread channel message notification.

Expanded

Single notification


message

  • adds message button with notifications and clicking of it opens a messages modal for quick look

chat

  • adds chat button with it’s functions

notificationToRoute

  • if do not disturb active the bell icon will change to bell-slash icon and the dnd until time is appears
    Screenshot 2024-12-13 at 13.02.35

  • redirects to profile notifications page bypass the notification menu

    • if there is notification it redirects to /notifications?filter=unread
    • if there is no notification it redirects to /notifications
    • if there is a reviewable content red flag will appear and redirects to /review

notificationMenu

  • if do not disturb active the bell icon will change to bell-slash icon and the dnd until time is appears
    Screenshot 2024-12-13 at 13.02.35

  • opens notification menu


search

  • redirects to context base /search page

Settings

I try to make the settings simple as possible.
It will contains four fields.

  • name: This is just for easier identify the tab in setting.
  • icon: Adds icon to the tab. Note: If you select a function there might be icons which not overridable with this setting.
  • destination: Adds destination for your custom tab. Note: If you select a function that will handle the destination so you can leave it empty. The component handle the /my/... destinations automatically convert to /u/username/... so the tabs active status can be added correctly.
  • function: Choose a function to the tab.

Admins can simply create/remove/change tabs and select from one of the functions or add a custom destination to the tab.
Functions :arrow_down_small:

E.g. adding topic creation tab will simply looks like this.


Screenshot 2024-12-12 at 18.55.50


Credit: Discourse Tab Bar for Mobile and thanks for everyone the feedbacks in F NAV - Theme component concept topic. :heart:

12 Likes

This is awesome and legit should be the default behavior and will save my thumb from trying to reach too often the far top screen of my :iphone:.

I’m not a fan of the prominent “online” toggle as I think most people don’t need to change this setting often, I guess most users choose to opt-out of their online presence once and for all so not sure of the constant reminder that this option exists.

You’ve apparently made lot of very useful navigation modification theme components. I’d like to use some, but how much do you see yourself maintaining all of this in the long run? I tend very much to use only official theme components to ensure reliability.

I didn’t see the original tab bar official theme component, so I’ll have a look at it.

5 Likes

Thanks for the component @don I’ve been here for a long time you’re really doing great work.

3 Likes

This should be a bug

2 Likes

Ah thanks, this is FKB theme related. I’ll update the theme.

2 Likes

Here is the fix: Compatibility: Adds support for F NAV theme component by VaperinaDEV · Pull Request #51 · VaperinaDEV/fkb-pro-theme · GitHub
Please update the FKB theme and enable this new setting.
Screenshot 2024-12-14 at 9.17.02

3 Likes

Hello @don, how can I use fa-regular icons like in the picture? I did some research and couldn’t find any information on how to do it after switching to Fontawesome 6.

3 Likes

Hello :wave: It should work with far-bell. I had plans to make it regular to solid when tab is active, I’ll check this but if I remember correctly the house icon only have solid in free version. :thinking:

1 Like

Thanks, I solved my problem. @Don

1 Like

The home icon, that changes to back button when open a topic. Why, we can use swaiping for that (like when returning to home screen of the Hub :smirk:). My users were complaining quite lot about that, because know they have to reach logo for that (1st world problem, I know :joy:)

2 Likes

I think we can add it to a function I am just thinking of where to place this. This can be a single tab and you can add it the navigation which only shows in DiscourseHub.

1 Like

Actually DiscourseHub works just fine with swiping down. I just didn’t know that.

That question of home/back button is bigger because I have to explain it to others.

3 Likes

The back button is only activate in topics to makes the back navigation easier between topics. It’s from the home function which you can turn off and then this will keep the home destination.

The settings cannot be reorder yet and if you have an existed selection you cannot clear it but I add a new function none which will be the same behaviour like you leave the function field empty. This way you don’t have to recreate the whole navigation tabs.

This is how it should be if you want to disable the back button and keep the home everywhere.

3 Likes

Fantastic as always. I have to agree from the quick preview on theme creator. This really should be package in core with a toggle for classic mobile and Improved Mobile.

I can see this opening things like longer banner site logo. Cleaner option for extras in the header like local selector and more. Very very nice as always Don!

2 Likes