Skip to content

Conversation

MichaelBuessemeyer
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer commented Mar 27, 2025

The action items in the ai models list are misaligned if there are multiple. This PR cleans this up. All actions should now have their own row and be left aligned together. Similar to the actions column in the dataset table. See:
image

Oh and I added some icons as I though it looks nicer this way :D

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Somehow get an entry into the ai models table
    • test locally & enable jobs (no need to run the worker)
    • create an annotation on a dataset with a volume layer
    • create some bounding boxes
    • start an ai model training job
    • Open the AI model list. The action should now be aligned
    • To add more items to the actions, you could go ahead and edit the code a little: in ai_model_list_view.tsx add <Row>{organizationSharingButton}</Row> multiple times after line 205. Allowing to check how it would look like when the job was successful.

Issues:


(Please delete unneeded items, merge only when none are left open)

@MichaelBuessemeyer MichaelBuessemeyer added frontend css Something frontend styling related labels Mar 27, 2025
@MichaelBuessemeyer MichaelBuessemeyer self-assigned this Mar 27, 2025
Copy link
Contributor

coderabbitai bot commented Mar 27, 2025

📝 Walkthrough

Walkthrough

This pull request modifies the UI in the AI model list view. The changes include replacing the "EditOutlined" icon with the "TeamOutlined" icon for managing access, and adding a conditional check to display the organization sharing button only when the training job state is "SUCCESS". It also introduces updated icon rendering for the Voxelytics Report and training data links, and refactors the layout to use Ant Design's Col and Row components instead of a simple div structure. Additionally, the training job object is now destructured to include the state property.

Changes

File(s) Change Summary
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx - Replaced EditOutlined with TeamOutlined for access management button
- Added a condition to show org sharing button only when trainingJob.state === "SUCCESS"
- Updated the Voxelytics Report link with FileTextOutlined and training data links with EyeOutlined
- Refactored layout to use Ant Design’s Col and Row components
CHANGELOG.unreleased.md - Added entry in "Fixed" section addressing visual alignment of actions in the AI model list.

Possibly related PRs

Suggested labels

usability

Suggested reviewers

  • hotzenklotz

Poem

I'm a little rabbit in the code garden so bright,
Hopping through icons that gleam in the light.
With rows and columns set perfectly neat,
"SUCCESS" brings joy in every heartbeat.
I nibble on updates with a joyful delight 🐇✨!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ace483 and 598485c.

📒 Files selected for processing (1)
  • CHANGELOG.unreleased.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.unreleased.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
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: 0

🧹 Nitpick comments (2)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (2)

205-205: Consider using consistent styling for all action rows

For better visual consistency, consider applying the same left margin to all action rows, including the organization sharing button.

-      {trainingJobState === "SUCCESS" ? <Row>{organizationSharingButton}</Row> : null}
+      {trainingJobState === "SUCCESS" ? <Row style={{ marginLeft: 16 }}>{organizationSharingButton}</Row> : null}

214-217: Inconsistent styling pattern between icons

The EyeOutlined icon uses both className and inline style properties, while FileTextOutlined doesn't use any special styling. For consistency, consider using the same styling approach for all icons.

-          <EyeOutlined
-            className="icon-margin-right"
-            style={{ color: "var(--ant-color-primary)" }}
-          />
+          <EyeOutlined className="icon-margin-right" />

Or apply the primary color styling to both icons:

-          <FileTextOutlined />
+          <FileTextOutlined 
+            className="icon-margin-right"
+            style={{ color: "var(--ant-color-primary)" }} 
+          />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1943705 and ce4c7aa.

📒 Files selected for processing (1)
  • frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (1)
frontend/javascripts/admin/job/job_list_view.tsx (1)
  • getShowTrainingDataLink (67-109)
🔇 Additional comments (5)
frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (5)

1-7: Appropriate icon imports added for improved visual representation

The addition of EyeOutlined, FileTextOutlined, and TeamOutlined icons from Ant Design provides better visual cues for the respective action items. The TeamOutlined icon is a more semantically appropriate choice for the "Manage Access" action compared to the previous EditOutlined icon.


10-10: Added necessary Ant Design components for layout improvements

Adding Col and Row components from Ant Design is essential for implementing the row-based layout that addresses the alignment issues mentioned in the PR description.


190-192: Improved icon choice for Manage Access functionality

Replacing the generic EditOutlined icon with the more specific TeamOutlined icon better represents the "Manage Access" functionality, improving the UI's intuitiveness.


197-201: Enhanced destructuring to support conditional rendering

Good addition of the state property (aliased as trainingJobState) to the destructuring. This enables the conditional rendering of the organization sharing button based on the training job's state.


204-221: Fixed alignment of action items as intended

This restructuring resolves the alignment issue mentioned in the PR description by:

  1. Using Ant Design's layout components (Col and Row) for consistent spacing
  2. Placing each action in its own row for clear visual separation
  3. Adding proper spacing with marginLeft to create a consistent indentation pattern
  4. Including icons that provide visual cues for different action types

The conditional rendering based on trainingJobState === "SUCCESS" ensures the organization sharing button only appears when appropriate.

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: 0

🧹 Nitpick comments (1)
CHANGELOG.unreleased.md (1)

35-35: Refine Changelog Entry Description
The changelog entry on line 35 reads:
- Fixed visual alignment of actions in ai model list. [#8474](https://github.com/scalableminds/webknossos/pull/8474)
Consider enhancing this entry to explicitly mention that multiple action items in the "actions" column are now displayed on their own rows and are left-aligned. This will more clearly communicate the fix in accordance with the PR objectives.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce4c7aa and 0ca7b30.

📒 Files selected for processing (2)
  • CHANGELOG.unreleased.md (1 hunks)
  • frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build

Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Sorry for the wait. Thanks for fixing this 🙏

@MichaelBuessemeyer MichaelBuessemeyer enabled auto-merge (squash) April 2, 2025 07:59
@MichaelBuessemeyer MichaelBuessemeyer merged commit b3c0446 into master Apr 2, 2025
3 checks passed
@MichaelBuessemeyer MichaelBuessemeyer deleted the fix-ai-model-sharing-ui branch April 2, 2025 08:13
@coderabbitai coderabbitai bot mentioned this pull request Oct 10, 2025
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css Something frontend styling related frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants