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

feat(ui): preview improvements + moving back to cesium #849

Merged
merged 6 commits into from
Feb 12, 2025

Conversation

KaWaite
Copy link
Member

@KaWaite KaWaite commented Feb 10, 2025

Overview

What I've done

What I haven't done

How I tested

Screenshot

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Advanced 3D mapping and visualization capabilities powered by new libraries.
    • Interactive, resizable panels in the editor enhance layout flexibility.
    • Data tables now support a streamlined “condensed” display option.
  • Refactor

    • Legacy mapping functionality was replaced with enhanced components.
    • Panel interfaces and control elements were updated for a more streamlined look.
    • Outdated localization entries were removed to simplify language support.
  • Chores

    • Updated project dependencies and build configuration for improved 3D integration.

Copy link
Contributor

coderabbitai bot commented Feb 10, 2025

Walkthrough

The pull request overhauls mapping and UI components. It replaces Maplibre and React-Map-GL with Cesium and Resium by updating dependencies and introducing new Cesium components. Several DataTable components now use a boolean “condensed” property instead of a fixed row height. In addition, Editor panels have been refactored with resizable layouts and updated button elements. Workspace components remove explicit row height settings, and key strings in localization files have been cleaned up. Finally, the Vite configuration is updated to integrate the new Cesium plugin.

Changes

File(s) Change Summary
ui/package.json Dependencies: Added "cesium": "1.126.0", "resium": "1.19.0-beta.1", and "vite-plugin-cesium": "1.2.23"; removed "maplibre-gl": "4.7.1" and "react-map-gl": "7.1.9".
ui/src/components/visualizations/Cesium/Contents.tsx,
ui/src/components/visualizations/Cesium/index.tsx,
ui/src/components/visualizations/Map/index.tsx,
ui/src/components/visualizations/index.ts
Mapping Components: Introduced new Cesium components (CesiumContents, CesiumViewer), removed the legacy Map component, and updated exports to reflect the shift to Cesium.
ui/src/components/DataTable/index.tsx,
ui/src/features/Editor/components/BottomPanel/components/DataTable/index.tsx
DataTable Update: Replaced the rowHeight property with a new condensed boolean prop and adjusted container styles and overflow behavior.
ui/src/features/Editor/components/BottomPanel/components/BaseActionButtons/index.tsx,
ui/src/features/Editor/components/BottomPanel/components/Contents/index.tsx,
ui/src/features/Editor/components/BottomPanel/hooks.tsx,
ui/src/features/Editor/components/BottomPanel/index.tsx,
ui/src/features/Editor/components/BottomPanel/components/Map/index.tsx,
ui/src/features/Editor/components/LeftPanel/index.tsx,
ui/src/features/Editor/components/OverlayUI/components/Infobar/index.tsx,
ui/src/features/Editor/components/OverlayUI/index.tsx,
ui/src/features/Editor/index.tsx
Editor UI Enhancements: Changed icon to button properties, modified layout class names, switched to a resizable panel layout with an updated default visualization mode, removed map mode controls from the Map component, and added console logging.
ui/src/features/WorkspaceDeployments/components/DeploymentsDialog.tsx,
ui/src/features/WorkspaceDeployments/index.tsx,
ui/src/features/WorkspaceJobs/index.tsx,
ui/src/features/WorkspaceTriggers/index.tsx
Workspace Components: Removed explicit rowHeight definitions from Table components across deployments, jobs, and triggers.
ui/src/lib/i18n/locales/en.json,
ui/src/lib/i18n/locales/es.json,
ui/src/lib/i18n/locales/fr.json,
ui/src/lib/i18n/locales/ja.json,
ui/src/lib/i18n/locales/zh.json
Localization: Removed keys for "2D" and "3D" along with additional deprecated strings in the Spanish locale.
ui/vite.config.ts Build Configuration: Added the vite-plugin-cesium plugin to integrate Cesium into the Vite build process.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Editor
    participant CesiumViewer
    participant CesiumContents
    participant CesiumEngine as Cesium Engine
    User->>Editor: Load Editor
    Editor->>CesiumViewer: Render CesiumViewer component
    CesiumViewer->>CesiumContents: Pass isLoaded state
    CesiumContents->>CesiumEngine: Configure camera view and render entity
Loading
sequenceDiagram
    participant User
    participant ResizablePanelGroup
    participant DataTable
    participant CesiumViewer
    User->>ResizablePanelGroup: Adjust panel sizes via handle
    ResizablePanelGroup->>DataTable: Display DataTable (default 65%)
    ResizablePanelGroup->>CesiumViewer: Display CesiumViewer (default 35%)
Loading

Possibly related PRs

Poem

I'm a rabbit with ideas that hop,
In a world of maps, I just can’t stop.
New Cesium skies and panels that flex,
Code paths transformed, what a complex mix!
I nibble on bytes and cheer with glee, 🐰
Celebrating changes in our digital spree!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for reearth-flow ready!

Name Link
🔨 Latest commit 3a0088f
🔍 Latest deploy log https://app.netlify.com/sites/reearth-flow/deploys/67ac30a9eeb1740009cd0c60
😎 Deploy Preview https://deploy-preview-849--reearth-flow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@KaWaite KaWaite marked this pull request as ready for review February 12, 2025 05:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
ui/src/features/Editor/components/LeftPanel/index.tsx (1)

137-139: ⚠️ Potential issue

Remove keyboard shortcut for the removed Resources tab.

The keyboard shortcut for the Resources tab should be removed since the tab itself has been removed.

-    {
-      keyBinding: { key: "r", shiftKey: true },
-      callback: () => handleTabChange("resources"),
-    },
🧹 Nitpick comments (9)
ui/src/features/Editor/components/BottomPanel/index.tsx (2)

64-75: Simplify the IconButton container styling.

The IconButton container has explicit height and padding that could be simplified using Tailwind's flex utilities.

Consider this more concise styling:

-          <div className="flex h-[29px] items-center px-1">
+          <div className="flex items-center px-1">
             <IconButton
               className="h-4/5 w-[55px]"
               icon={windowSize === "min" ? <CornersOut /> : <CornersIn />}
               tooltipPosition="top"
               onClick={() =>
                 windowSize === "min"
                   ? setWindowSize("max")
                   : setWindowSize("min")
               }
             />
           </div>

The parent flex and items-center classes will naturally center the IconButton without needing an explicit height.


34-43: Add type safety for window size state.

Consider adding a type definition for the window size state to improve maintainability and prevent potential bugs.

Add this type definition:

type WindowSize = "min" | "max";

const {
  selectedId,
  windowSize,
  panelContentOptions,
  setWindowSize,
  handleSelection,
} = useHooks<WindowSize>({
  isOpen,
  onOpen,
});
ui/src/features/Editor/components/BottomPanel/hooks.tsx (1)

31-42: Consider adding ARIA labels for accessibility.

The changes from icon to button are consistent with the type changes. However, since these are interactive elements, consider adding ARIA labels for better accessibility.

Apply this diff to improve accessibility:

   {
     id: "output-log",
-    button: <Terminal className="size-[20px]" weight="thin" />,
+    button: <Terminal className="size-[20px]" weight="thin" aria-label={t("Log")} />,
     title: t("Log"),
   },
   {
     id: "visual-preview",
-    button: <Globe className="size-[20px]" weight="thin" />,
+    button: <Globe className="size-[20px]" weight="thin" aria-label={t("Preview")} />,
     title: t("Preview"),
   },
ui/src/features/Editor/components/BottomPanel/components/DataTable/index.tsx (2)

6-7: Address the TODO comment before production deployment.

The comment indicates this is placeholder code. We should plan to implement the dynamic type inference or fixed types based on the API implementation.

Would you like me to help implement the dynamic type inference system or create an issue to track this task?


82-83: Consider using overflow-auto instead of overflow-scroll.

The change from overflow-auto to overflow-scroll will force scrollbars to always be visible, even when not needed. This might not provide the best user experience across different operating systems and browsers.

-      <div className="m-2 mb-1 box-border flex-1 overflow-scroll">
+      <div className="m-2 mb-1 box-border flex-1 overflow-auto">
ui/src/components/visualizations/Cesium/index.tsx (1)

20-26: Consider simplifying the isLoaded state logic.

You can set isLoaded once inside a useEffect with an empty dependency array to avoid the extra conditional:

 useEffect(() => {
-  if (isLoaded) return;
   setIsLoaded(true);
-}, [isLoaded]);
+}, []);
ui/src/components/visualizations/Cesium/Contents.tsx (2)

5-9: Remove or utilize the commented-out startingPosition.

Dead code may lead to confusion. If you need a different starting position in the future, consider making it a configurable constant or reintroduce it with a clear purpose.


10-15: Consider making the entity position configurable.

Hardcoded coordinates can limit flexibility. Storing them in a config file or passing them as props would make the component more reusable.

ui/src/features/Editor/components/OverlayUI/components/Infobar/index.tsx (1)

10-21: Consider reducing hover delay for better UX.

The 1-second delay before showing the infobar might feel too long for users. Consider reducing it to 300-500ms for a more responsive experience while still preventing unwanted popups.

-    }, 1000);
+    }, 300);
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afdce43 and 3a0088f.

⛔ Files ignored due to path filters (1)
  • ui/yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !**/*.lock
📒 Files selected for processing (26)
  • ui/package.json (3 hunks)
  • ui/src/components/DataTable/index.tsx (5 hunks)
  • ui/src/components/visualizations/Cesium/Contents.tsx (1 hunks)
  • ui/src/components/visualizations/Cesium/index.tsx (1 hunks)
  • ui/src/components/visualizations/Map/index.tsx (0 hunks)
  • ui/src/components/visualizations/index.ts (1 hunks)
  • ui/src/features/Editor/components/BottomPanel/components/BaseActionButtons/index.tsx (2 hunks)
  • ui/src/features/Editor/components/BottomPanel/components/Contents/index.tsx (2 hunks)
  • ui/src/features/Editor/components/BottomPanel/components/DataTable/index.tsx (1 hunks)
  • ui/src/features/Editor/components/BottomPanel/components/Map/index.tsx (1 hunks)
  • ui/src/features/Editor/components/BottomPanel/hooks.tsx (1 hunks)
  • ui/src/features/Editor/components/BottomPanel/index.tsx (2 hunks)
  • ui/src/features/Editor/components/LeftPanel/index.tsx (3 hunks)
  • ui/src/features/Editor/components/OverlayUI/components/Infobar/index.tsx (1 hunks)
  • ui/src/features/Editor/components/OverlayUI/index.tsx (1 hunks)
  • ui/src/features/Editor/index.tsx (1 hunks)
  • ui/src/features/WorkspaceDeployments/components/DeploymentsDialog.tsx (0 hunks)
  • ui/src/features/WorkspaceDeployments/index.tsx (0 hunks)
  • ui/src/features/WorkspaceJobs/index.tsx (0 hunks)
  • ui/src/features/WorkspaceTriggers/index.tsx (0 hunks)
  • ui/src/lib/i18n/locales/en.json (0 hunks)
  • ui/src/lib/i18n/locales/es.json (0 hunks)
  • ui/src/lib/i18n/locales/fr.json (0 hunks)
  • ui/src/lib/i18n/locales/ja.json (0 hunks)
  • ui/src/lib/i18n/locales/zh.json (0 hunks)
  • ui/vite.config.ts (2 hunks)
💤 Files with no reviewable changes (10)
  • ui/src/features/WorkspaceTriggers/index.tsx
  • ui/src/features/WorkspaceJobs/index.tsx
  • ui/src/lib/i18n/locales/en.json
  • ui/src/lib/i18n/locales/zh.json
  • ui/src/features/WorkspaceDeployments/index.tsx
  • ui/src/lib/i18n/locales/ja.json
  • ui/src/components/visualizations/Map/index.tsx
  • ui/src/features/WorkspaceDeployments/components/DeploymentsDialog.tsx
  • ui/src/lib/i18n/locales/fr.json
  • ui/src/lib/i18n/locales/es.json
✅ Files skipped from review due to trivial changes (2)
  • ui/src/features/Editor/index.tsx
  • ui/src/components/visualizations/index.ts
🧰 Additional context used
🪛 Biome (1.9.4)
ui/src/features/Editor/components/BottomPanel/components/Map/index.tsx

[error] 7-7: Do not shadow the global "Map" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🔇 Additional comments (19)
ui/src/features/Editor/components/BottomPanel/index.tsx (2)

47-47: LGTM! Improved border styling organization.

The border styling has been appropriately moved from the main container to the inner elements for better visual hierarchy.


81-81: LGTM! Consistent styling with top edge.

The added classes maintain visual consistency with the top edge section and ensure proper content contrast.

ui/src/features/Editor/components/BottomPanel/components/BaseActionButtons/index.tsx (3)

19-25: Verify visual impact of CSS changes.

The changes include:

  • Reduced min-width from 140px to 120px
  • Removed default background color when not selected

Please ensure these changes don't cause layout issues or reduce visibility of unselected buttons.


27-27: LGTM!

The change from content.icon to content.button aligns with the type changes.


5-9: Breaking change: Renamed icon to button in PanelContent type.

This type change affects all consumers of the PanelContent type. Ensure that all components using this type have been updated accordingly.

Run the following script to verify all usages of the PanelContent type:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Find all files using PanelContent type and verify they use 'button' instead of 'icon'.

# Find files importing or using PanelContent
rg -l "PanelContent" --type typescript

# Check for any remaining usages of 'icon' property
rg "icon.*:.*React\.ReactNode" --type typescript

Length of output: 159


Let's re-run the search commands without using the unsupported file type flag and using file globs for .ts/.tsx files:


🏁 Script executed:

#!/bin/bash
echo "Searching for PanelContent usage in TS/TSX files..."
rg -l "PanelContent" -g "*.ts" -g "*.tsx"

echo "Searching for any remaining usages of 'icon' property in TS/TSX files..."
rg "icon\s*:.*React\.ReactNode" -g "*.ts" -g "*.tsx"

Length of output: 929


PanelContent type update is correctly applied and isolated from unrelated "icon" usages.

  • The updated definition in ui/src/features/Editor/components/BottomPanel/components/BaseActionButtons/index.tsx now correctly uses button?: React.ReactNode; instead of icon.
  • Searches confirm that files importing and using PanelContent do not reference an icon within that type.
  • The remaining occurrences of icon: React.ReactNode in other parts of the codebase belong to different components/types and are not affected by this breaking change.
ui/src/features/Editor/components/BottomPanel/components/DataTable/index.tsx (1)

84-90: Verify prop types for the Table component.

The component uses new props (condensed, selectColumns, showFiltering) without explicit type definitions in this file.

Let's verify the prop types are properly defined in the imported Table component:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check prop types in the Table component

# Search for Table component prop types
ast-grep --pattern 'interface $interface {
  $$$
  condensed?: boolean
  $$$
}'

# Search for Table component implementation
ast-grep --pattern 'const Table = $_({
  $$$
  condensed,
  selectColumns,
  showFiltering
  $$$
})'

Length of output: 184


Manual verification needed: Table component prop types

The initial search did not produce any evidence that the new props (condensed, selectColumns, and showFiltering) are explicitly typed in the Table component. To further investigate, please run the following additional script to search for any interface or type declarations (like TableProps) that might include these props:

If these searches do not reveal explicit type definitions for the new props, please manually verify whether the Table component relies on implicit TypeScript inference or other patterns to include these props. Adjustments may be necessary to ensure proper type definitions.


🏁 Script executed:

[run_scripts]
#!/bin/bash
echo "Searching for TableProps interface definitions with new props:"
rg -n "interface\s+TableProps" .

echo "Searching for 'condensed?: boolean' in the repository:"
rg -n "condensed\\?:\\s*boolean" .

echo "Searching for 'selectColumns?: boolean' in the repository:"
rg -n "selectColumns\\?:\\s*boolean" .

echo "Searching for 'showFiltering?: boolean' in the repository:"
rg -n "showFiltering\\?:\\s*boolean" .

echo "Searching for Table component definition:"
rg -n "export (const|function)\s+Table" .

Length of output: 1440


Table component prop types are properly defined.

Our investigation confirms that the new props (condensed, selectColumns, and showFiltering) are explicitly typed in the Table component’s prop interfaces. For example, in ui/src/components/DataTable/index.tsx the types are declared as follows:

  • condensed?: boolean;
  • selectColumns?: boolean;
  • showFiltering?: boolean;

These definitions ensure that the imported Table component correctly handles the new props used in ui/src/features/Editor/components/BottomPanel/components/DataTable/index.tsx.

ui/src/features/Editor/components/BottomPanel/components/Map/index.tsx (1)

9-10: Simplified rendering approach looks good.

By removing the old map modes and directly rendering <CesiumViewer />, you've streamlined the component.

ui/src/components/visualizations/Cesium/index.tsx (2)

6-7: Ensure Cesium’s required credits are displayed to comply with licensing.

You’ve set up a dummyCredit container, which may hide the credits required by Cesium’s license. Verify that licensing requirements for attribution are met and consider showing these credits instead of bypassing them.


28-33: Well-structured use of resium’s Viewer.

The approach of passing props and maintaining the loaded state before rendering <CesiumContents> is clear and concise.

ui/src/components/visualizations/Cesium/Contents.tsx (1)

24-35: Camera initialization logic appears correct.

The isLoaded check prevents repeated camera resets, ensuring the view is only set once. This implementation is clear and should behave as intended.

ui/src/features/Editor/components/OverlayUI/components/Infobar/index.tsx (2)

6-6: LGTM! Type safety improvement.

Making hoveredDetails required improves type safety since the parent component now handles the undefined case.


23-23: LGTM! Better visibility with primary background.

The change from bg-background to bg-primary improves the infobar's visibility.

ui/src/features/Editor/components/BottomPanel/components/Contents/index.tsx (1)

37-55: LGTM! Improved layout with resizable panels.

The implementation of resizable panels enhances user experience by allowing flexible adjustment of the DataTable and Map sections.

ui/vite.config.ts (1)

11-11: LGTM! Cesium plugin integration.

The addition of vite-plugin-cesium and its integration into the plugins array is correct and aligns with the transition to Cesium.

Also applies to: 21-21

ui/src/features/Editor/components/OverlayUI/index.tsx (1)

86-86: LGTM! Safer Infobar rendering.

The conditional rendering ensures Infobar only appears when hoveredDetails exists, preventing potential runtime errors.

ui/src/components/DataTable/index.tsx (2)

48-48: Good improvement: Simplified row height control with boolean flag.

The change from a numeric rowHeight to a boolean condensed prop simplifies the API and makes the component more maintainable.

Also applies to: 64-64


209-209: Good addition: Cursor feedback for clickable rows.

Adding cursor-pointer provides better user feedback for clickable rows.

ui/package.json (2)

63-63: Good addition: Cesium setup with proper plugin support.

The addition of Cesium and its Vite plugin is well-structured:

  • Cesium core library for 3D visualization
  • Vite plugin for proper asset handling

Also applies to: 137-137


82-82: Verify compatibility of Resium beta version.

Using Resium v1.19.0-beta.1 in production could be risky. Please verify:

  1. Compatibility with Cesium v1.126.0
  2. Known issues or breaking changes in the beta release
✅ Verification successful

🌐 Web query:

What is the latest stable version of Resium? Are there any known issues with version 1.19.0-beta.1?

💡 Result:

The latest stable version of Resium is v1.18.x, while v1.19.0-beta.1 remains an unreleased beta version as of February 2025[10]. Based on available documentation:

Key Details

  • Stable releases follow semantic versioning with clear changelogs (e.g., v1.14.x included Cesium v1.85 support and bug fixes)[1][4].
  • Beta versions like v1.19.0-beta.x are pre-release builds for testing new features or major changes[10].

Known Issues in Beta Versions

While no specific issues are documented for v1.19.0-beta.x, beta versions generally carry risks such as:

  • Unstable API changes
  • Untested edge cases
  • Potential compatibility breaks with Cesium.js updates

For production use, stick to stable releases unless you need experimental features from betas[10].

Citations:


Resium Beta Version Caution: Consider Using the Stable Release

  • The latest stable version of Resium is v1.18.x; the beta version v1.19.0-beta.1 is unreleased and carries inherent risks (e.g., unstable API changes or compatibility issues).
  • There’s no specific documentation flagging breaking changes with Cesium v1.126.0 for this beta, but beta releases are generally less tested.
  • For production usage, it is advisable to either perform thorough compatibility testing with Cesium v1.126.0 or revert to the stable release.

{ key: "2d-map", value: t("2D") },
{ key: "3d-map", value: t("3D") },
];
const Map: React.FC<Props> = ({ className }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Rename the component to avoid overshadowing the global "Map" property.

JavaScript provides a built-in global Map. To prevent confusion or potential conflicts, consider renaming your component. For instance:

-const Map: React.FC<Props> = ({ className }) => {
+const FlowMap: React.FC<Props> = ({ className }) => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Map: React.FC<Props> = ({ className }) => {
const FlowMap: React.FC<Props> = ({ className }) => {
🧰 Tools
🪛 Biome (1.9.4)

[error] 7-7: Do not shadow the global "Map" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

Comment on lines +28 to +29
const [visualizationMode, _setVisualizationMode] =
useState<SupportedVisualizations>("3d-map");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove unused state setter.

The _setVisualizationMode is never used, suggesting it's no longer needed after the transition to Cesium.

-  const [visualizationMode, _setVisualizationMode] =
-    useState<SupportedVisualizations>("3d-map");
+  const visualizationMode: SupportedVisualizations = "3d-map";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const [visualizationMode, _setVisualizationMode] =
useState<SupportedVisualizations>("3d-map");
const visualizationMode: SupportedVisualizations = "3d-map";

@@ -14,7 +8,7 @@ import { useShortcuts } from "@flow/hooks";
import { useT } from "@flow/lib/i18n";
import type { Node } from "@flow/types";

import { ActionsList, Resources } from "./components";
import { ActionsList } from "./components";

type Tab = "navigator" | "actions-list" | "resources";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update type definition to remove 'resources'.

The Tab type still includes 'resources' even though the tab has been removed.

-type Tab = "navigator" | "actions-list" | "resources";
+type Tab = "navigator" | "actions-list";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type Tab = "navigator" | "actions-list" | "resources";
type Tab = "navigator" | "actions-list";

Comment on lines +107 to +112
// {
// id: "resources",
// title: "Resources",
// icon: <HardDrive className="size-5" weight="thin" />,
// component: <Resources />,
// },
Copy link
Contributor

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 leaving it in the codebase.

The Resources tab implementation should be removed entirely rather than commented out, as commented code can lead to confusion and maintenance issues.

-    // {
-    //   id: "resources",
-    //   title: "Resources",
-    //   icon: <HardDrive className="size-5" weight="thin" />,
-    //   component: <Resources />,
-    // },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// {
// id: "resources",
// title: "Resources",
// icon: <HardDrive className="size-5" weight="thin" />,
// component: <Resources />,
// },

@KaWaite KaWaite merged commit 2510280 into main Feb 12, 2025
19 checks passed
@KaWaite KaWaite deleted the ui/preview-improvements branch February 12, 2025 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant