Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add app title in browser tab title when nav is set to side #23066

Merged
merged 5 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import React from "react";
import { useSelector } from "react-redux";
import { builderURL } from "RouteBuilder";
import { getSelectedAppTheme } from "selectors/appThemingSelectors";
import {
getCurrentPageDescription,
getCurrentPageId,
} from "selectors/editorSelectors";
import HtmlTitle from "../../AppViewerHtmlTitle";
import { getCurrentPageId } from "selectors/editorSelectors";
import MobileNavToggle from "./MobileNavToggle";
import ApplicationName from "./ApplicationName";
import ShareButton from "./ShareButton";
Expand Down Expand Up @@ -62,7 +58,6 @@ const TopHeader = (props: TopHeaderProps) => {
"properties.colors.primaryColor",
"inherit",
);
const description = useSelector(getCurrentPageDescription);
const pageId = useSelector(getCurrentPageId);
const editorURL = useHref(builderURL, { pageId });

Expand All @@ -73,10 +68,6 @@ const TopHeader = (props: TopHeaderProps) => {
navColorStyle={navColorStyle}
primaryColor={primaryColor}
>
<HtmlTitle
description={description}
name={currentApplicationDetails?.name}
/>
<HeaderRow
className="relative h-12 px-3 md:px-6"
navColorStyle={navColorStyle}
Expand Down
16 changes: 15 additions & 1 deletion app/client/src/pages/AppViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import EditorContextProvider from "components/editorComponents/EditorContextProv
import AppViewerPageContainer from "./AppViewerPageContainer";
import { editorInitializer } from "utils/editor/EditorUtils";
import * as Sentry from "@sentry/react";
import { getViewModePageList } from "selectors/editorSelectors";
import {
getCurrentPageDescription,
getViewModePageList,
} from "selectors/editorSelectors";
import { getThemeDetails, ThemeMode } from "selectors/themeSelectors";
import { getSearchQuery } from "utils/helpers";
import { getSelectedAppTheme } from "selectors/appThemingSelectors";
Expand All @@ -34,6 +37,9 @@ import { initAppViewer } from "actions/initActions";
import { WidgetGlobaStyles } from "globalStyles/WidgetGlobalStyles";
import { getAppsmithConfigs } from "@appsmith/configs";
import useWidgetFocus from "utils/hooks/useWidgetFocus/useWidgetFocus";
import HtmlTitle from "./AppViewerHtmlTitle";
import type { ApplicationPayload } from "@appsmith/constants/ReduxActionConstants";
import { getCurrentApplication } from "@appsmith/selectors/applicationSelectors";

const AppViewerBody = styled.section<{
hasPages: boolean;
Expand Down Expand Up @@ -80,6 +86,10 @@ function AppViewer(props: Props) {
const branch = getSearchQuery(search, GIT_BRANCH_QUERY_KEY);
const prevValues = usePrevious({ branch, location: props.location, pageId });
const { hideWatermark } = getAppsmithConfigs();
const pageDescription = useSelector(getCurrentPageDescription);
const currentApplicationDetails: ApplicationPayload | undefined = useSelector(
getCurrentApplication,
);

const focusRef = useWidgetFocus();

Expand Down Expand Up @@ -171,6 +181,10 @@ function AppViewer(props: Props) {
fontFamily={selectedTheme.properties.fontFamily.appFont}
primaryColor={selectedTheme.properties.colors.primaryColor}
/>
<HtmlTitle
description={pageDescription}
name={currentApplicationDetails?.name}
/>
<AppViewerBodyContainer
backgroundColor={selectedTheme.properties.colors.backgroundColor}
>
Expand Down
Loading