-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: export button overlap issue #6149
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export const hideFloatingBot = () => {}; | ||
|
|
||
| export const showFloatingBot = () => {}; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,3 +1,4 @@ | ||||||||||||||||||||||||||||||||||||||||||
| import { useEffect } from "react"; | ||||||||||||||||||||||||||||||||||||||||||
| import { observer } from "mobx-react"; | ||||||||||||||||||||||||||||||||||||||||||
| import { useParams } from "next/navigation"; | ||||||||||||||||||||||||||||||||||||||||||
| import { useForm } from "react-hook-form"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -11,6 +12,7 @@ import { CustomAnalyticsSelectBar, CustomAnalyticsMainContent, CustomAnalyticsSi | |||||||||||||||||||||||||||||||||||||||||
| import { ANALYTICS } from "@/constants/fetch-keys"; | ||||||||||||||||||||||||||||||||||||||||||
| import { cn } from "@/helpers/common.helper"; | ||||||||||||||||||||||||||||||||||||||||||
| import { useAppTheme } from "@/hooks/store"; | ||||||||||||||||||||||||||||||||||||||||||
| import { hideFloatingBot, showFloatingBot } from "@/plane-web/helpers/pi-chat.helper"; | ||||||||||||||||||||||||||||||||||||||||||
| import { AnalyticsService } from "@/services/analytics.service"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| type Props = { | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -51,6 +53,13 @@ export const CustomAnalytics: React.FC<Props> = observer((props) => { | |||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const isProjectLevel = projectId ? true : false; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||
| hideFloatingBot(); | ||||||||||||||||||||||||||||||||||||||||||
| return () => { | ||||||||||||||||||||||||||||||||||||||||||
| showFloatingBot(); | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Review the useEffect dependencies and error handling The useEffect hook might run unnecessarily without dependencies. Also, consider adding error handling for the bot visibility functions. Consider this improvement: useEffect(() => {
- hideFloatingBot();
+ try {
+ hideFloatingBot();
+ } catch (error) {
+ console.error('Failed to hide floating bot:', error);
+ }
return () => {
- showFloatingBot();
+ try {
+ showFloatingBot();
+ } catch (error) {
+ console.error('Failed to show floating bot:', error);
+ }
};
- }, []);
+ }, []); // Empty deps array is fine as we only want this to run once📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||
| <div className={cn("relative flex h-full w-full overflow-hidden", isProjectLevel ? "flex-col-reverse" : "")}> | ||||||||||||||||||||||||||||||||||||||||||
| <div className="flex h-full w-full flex-col overflow-hidden"> | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Implementation required for hideFloatingBot and showFloatingBot functions
The functions are currently empty, which could lead to runtime issues. Consider implementing the actual functionality to control the floating bot visibility.
Consider adding TypeScript types and documentation: