Skip to content

Image pane improvements#279

Closed
namvdo wants to merge 2 commits intomainfrom
image-pane-improvement
Closed

Image pane improvements#279
namvdo wants to merge 2 commits intomainfrom
image-pane-improvement

Conversation

@namvdo
Copy link
Collaborator

@namvdo namvdo commented Sep 18, 2025

  • Add a button to jump to the active image pane
  • Add a pulldown menu containing available image panes.

@namvdo namvdo self-assigned this Sep 18, 2025
@namvdo namvdo added the UI Involves the user interface label Sep 18, 2025
@namvdo namvdo added this to the Alpha release milestone Sep 18, 2025
@namvdo namvdo linked an issue Sep 18, 2025 that may be closed by this pull request
Copy link
Owner

@joyhughes joyhughes left a comment

Choose a reason for hiding this comment

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

Screenshot 2025-10-04 at 9 16 37 PM Here, include the words "source image" and display the thumbnail - clicking on thumbnail will jump to image plane.

In cellular automata scene, do the same with source and target images - image pane will display the menu with both source and target images.

IMG_2860

Copy link
Owner

@joyhughes joyhughes left a comment

Choose a reason for hiding this comment

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

Screenshot 2025-10-15 at 4 04 47 AM Scene thumbnails have disappeared

@joyhughes
Copy link
Owner

Screenshot 2025-10-15 at 4 05 51 AM Source image selector should be within a widget container

@joyhughes
Copy link
Owner

Screenshot 2025-10-15 at 4 14 56 AM In CA scene, target image selector should be a widget, showing the target image thumbnail. Widget should only be displayed if target switch is on.

On image pane, both source and target image should appear in the menu

@joyhughes joyhughes self-requested a review November 16, 2025 19:05
const activeImage = getActiveImage();

// Determine if the active image is source or target based on widget name
const getImageLabel = () => {
Copy link
Owner

Choose a reason for hiding this comment

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

Remove the functions below. All image pickers should be handled the same as any other widget. They should use the same font as other widgets, with the name of the widget followed by the thumbnail.

Clicking on thumbnail should go to image pane.

    // Determine if the active image is source or target based on widget name
    const getImageLabel = () => {
        if (!activeImage) return "Images";
        const widgetName = activeImage.name.toLowerCase();
        if (widgetName.includes('source')) return "Source Image";
        if (widgetName.includes('target')) return "Target Image";
        return "Images";
    };

    // Filter out any group that has image picker widgets for the Home pane
    const nonImageGroups = activeGroups.filter(group => {
        // For groups, check if they have image pickers
        if (group.widgets) {
            const hasImageWidget = group.widgets.some(widgetName => {
                try {
                    const widgetJSON = window.module?.get_widget_JSON(widgetName);
                    const widget = JSON.parse(widgetJSON);
                    return widget?.tool === 'image';
                } catch (error) {
                    return false;
                }
            });

            return !hasImageWidget;
        }

        return true;
    });

minWidth: 'auto'
}}
>
<Box sx={{
Copy link
Owner

Choose a reason for hiding this comment

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

Remove the following section. Image picker should be handled like other widgets.

                            display: 'flex', 
                            alignItems: 'center', 
                            gap: 1
                        }}>
                            <Typography variant="body2" sx={{ fontWeight: 500 }}>
                                {getImageLabel()}
                            </Typography>
                            {activeImage && (
                                <Box
                                    sx={{
                                        width: 32,
                                        height: 32,
                                        borderRadius: 0.5,
                                        border: '1px solid',
                                        borderColor: 'primary.main',
                                        boxShadow: 1,
                                        overflow: 'hidden',
                                        flexShrink: 0
                                    }}
                                >
                                    <ThumbnailCanvas
                                        imageName={activeImage.path}
                                        width={32}
                                        height={32}
                                        setStatus={setThumbnailStatus}
                                    />
                                </Box>
                            )}
                        </Box>

@joyhughes
Copy link
Owner

In widget_group.jsx line 115, no longer disable image widgets. Include the name of the widget and thumbnail, click takes to image pane.

            case 'menu_string':
                if (widget.tool === 'image' && !disableImageWidgets) {
                    return (
                        <Box key={widget.name} sx={{ mb: 1, width: '100%' }}>
                            <MasonryImagePicker
                                json={widget}
                                width="100%"
                                onChange={onChange}
                                imageType={widget.name === 'source_image_menu' ? 'source' : 'target' }
                            />
                        </Box>
                    );
                }

@namvdo namvdo closed this Nov 29, 2025
@namvdo namvdo reopened this Nov 29, 2025
@namvdo
Copy link
Collaborator Author

namvdo commented Nov 30, 2025

Please take a look at: #282 instead

@namvdo namvdo closed this Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Involves the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image pane improvements

2 participants