-
Notifications
You must be signed in to change notification settings - Fork 2
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(ui): close for successful submission and no params message #713
Conversation
WalkthroughThe pull request introduces modifications to the UI components and localization files, focusing on simplifying the Changes
Suggested reviewers
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ Deploy Preview for reearth-flow ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
ui/src/lib/i18n/locales/fr.json (1)
Line range hint
60-60
: Missing French translations for new UI elements.The following keys have been added without French translations:
- "General shortcuts"
- "Manage Projects"
- "Trigger1"
This could impact the user experience for French users. Please provide appropriate translations for these UI elements.
Suggested translations:
- "General shortcuts": "", + "General shortcuts": "Raccourcis généraux", - "Manage Projects": "", + "Manage Projects": "Gérer les projets", - "Trigger1": "", + "Trigger1": "Déclencheur1"Also applies to: 89-89, 123-123
🧹 Nitpick comments (5)
ui/src/features/Editor/components/RightPanel/components/ParamEditor/index.tsx (1)
49-51
: Consider improving accessibility for the Parameters sectionThe parameters section could benefit from proper ARIA attributes and heading structure.
Consider this improvement:
- <div className="flex flex-col gap-2"> - <p className="text-lg dark:font-thin">{t("Parameters")}</p> - </div> + <div className="flex flex-col gap-2" role="region" aria-label={t("Parameters")}> + <h2 className="text-lg dark:font-thin">{t("Parameters")}</h2> + </div>ui/src/features/Editor/components/RightPanel/index.tsx (2)
Line range hint
17-24
: Consider making the click event dispatch more robustWhile the current implementation works, the click event dispatch could be more robust.
Consider this improvement:
const closePanel = useCallback(() => { const paneElement = document.getElementsByClassName("react-flow__pane")[0]; if (!paneElement) return; - const clickEvent = new Event("click", { bubbles: true, cancelable: true }); + const clickEvent = new MouseEvent("click", { + bubbles: true, + cancelable: true, + view: window, + detail: 1 + }); paneElement.dispatchEvent(clickEvent); }, []);
26-32
: Consider simplifying the Promise handlingThe
Promise.resolve
wrap might be unnecessary ifonParamsSubmit
is already returning a Promise.Consider this simplification if
onParamsSubmit
is async:const handleParamsSubmit = useCallback( async (nodeId: string, data: any) => { - await Promise.resolve(onParamsSubmit(nodeId, data)); + await onParamsSubmit(nodeId, data); closePanel(); }, [onParamsSubmit, closePanel], );ui/src/lib/i18n/locales/es.json (1)
Line range hint
12-14
: Complete missing translationsSeveral new UI strings have empty translations which may affect Spanish users:
- "3D visualization is not supported in this browser"
- "2D"
- "3D"
- "Choose action"
- "Subworkflow Node"
- "General shortcuts"
- "Manage Projects"
- "Ran by:"
- "Trigger1"
Consider adding appropriate Spanish translations for these strings.
Also applies to: 44-44, 47-47, 62-62, 102-102, 125-125, 134-134
ui/src/lib/i18n/locales/zh.json (1)
Line range hint
47-47
: Complete missing translationsThe following UI strings have empty translations which may affect Chinese users:
- "Subworkflow Node"
- "Manage Projects"
- "Trigger1"
Consider adding appropriate Chinese translations for these strings.
Also applies to: 102-102, 134-134
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
ui/src/features/Editor/components/RightPanel/components/ParamEditor/index.tsx
(4 hunks)ui/src/features/Editor/components/RightPanel/index.tsx
(5 hunks)ui/src/lib/i18n/locales/en.json
(1 hunks)ui/src/lib/i18n/locales/es.json
(1 hunks)ui/src/lib/i18n/locales/fr.json
(1 hunks)ui/src/lib/i18n/locales/ja.json
(1 hunks)ui/src/lib/i18n/locales/zh.json
(1 hunks)
🔇 Additional comments (7)
ui/src/lib/i18n/locales/en.json (1)
53-53
: LGTM! Translation addition aligns with PR objectives
The new translation entry for "No Parameters Available" is properly formatted and consistent with other entries.
ui/src/features/Editor/components/RightPanel/components/ParamEditor/index.tsx (1)
Line range hint 58-64
: LGTM! Conditional rendering implementation
The implementation of the "No Parameters Available" message and conditional form rendering is clean and aligns with the PR objectives.
ui/src/features/Editor/components/RightPanel/index.tsx (1)
48-48
: LGTM! Implementation aligns with PR objectives
The changes successfully implement the requirement to close the panel after successful submission. The code is well-documented and the implementation is clean.
Also applies to: 67-67
ui/src/lib/i18n/locales/es.json (1)
53-53
: LGTM: Parameter message translation is complete
The Spanish translation for "No Parameters Available" is properly implemented as "No hay parámetros disponibles", which aligns with the PR objectives.
ui/src/lib/i18n/locales/ja.json (1)
53-53
: LGTM: Parameter message translation is complete
The Japanese translation for "No Parameters Available" is properly implemented as "利用可能なパラメータはありません", which aligns with the PR objectives.
ui/src/lib/i18n/locales/zh.json (1)
53-53
: LGTM: Parameter message translation is complete
The Chinese translation for "No Parameters Available" is properly implemented as "没有可用参数", which aligns with the PR objectives.
ui/src/lib/i18n/locales/fr.json (1)
53-53
: LGTM: Clear and accurate French translation for the "No Parameters Available" message.
The translation "Aucun paramètre disponible" is grammatically correct and naturally conveys the intended meaning in French.
{/* <TabsTrigger className="flex-1" value="data"> | ||
{t("Node data")} | ||
</TabsTrigger> | ||
</TabsList> | ||
</TabsTrigger> */} |
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
Remove commented out code
Instead of keeping commented code, it should be removed as it can be retrieved from version control if needed in the future. This improves code maintainability and readability.
Also applies to: 68-88
const handleClick = useCallback((e: MouseEvent) => { | ||
e.stopPropagation(); | ||
|
||
const closePanel = useCallback(() => { |
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.
handlePanelClose
Overview
Small UI improves for the right panel node params.
What I've done
What I haven't done
How I tested
Manually
Screenshot
Which point I want you to review particularly
Memo
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Localization Updates