Skip to content

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Mar 17, 2025

Fixed the CSS spacing for the task actions in the Dashboard > Tasks view. The same issue is also present in some of the other list views that have a similar "Actions" column.

High-level the underlying issue has to do with several factors:

  • a mix of components representing each action (<span>, <ButtonLink>, <a>, <AsyncLink) with different stylings
  • A mixed use of the <ButtonLink> component. Sometimes the icon was passed a prop and had the default antd spacing applied. Other times, the icon was wrapped as child with it's on margin-right. (And worse case, you do both and end up with twice the right spacing :-/ )
Screenshot 2025-03-17 at 16 02 34

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Create a new task
  • Go to Dashboard -> Task and request a task
  • Action should neatly line up

Issues:


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

@hotzenklotz hotzenklotz added frontend css Something frontend styling related labels Mar 17, 2025
@hotzenklotz hotzenklotz requested a review from philippotto March 17, 2025 14:45
Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

📝 Walkthrough

Walkthrough

The changes involve updates to several UI components, primarily focusing on the LinkButton elements. <span> labels have been replaced with <LinkButton> components that include icons for actions such as "View," "Open," "Download," and task management functions. The layout has been improved by consolidating multiple elements into a single <Space> component, and unnecessary wrappers have been removed from conditional rendering for admin actions. Additionally, an issue with icon spacing on the task dashboard page has been addressed.

Changes

File Change Summary
frontend/.../dashboard_task_list_view.tsx - Replaced <span> labels with <LinkButton> components including icons for "View" and "Open".
- Simplified layout using a single <Space> component.
- Streamlined conditional rendering for admin actions by removing redundant wrappers and <br /> tags.
CHANGELOG.unreleased.md - Fixed an issue related to icon spacing on the task dashboard page, enhancing the visual layout.
frontend/.../time_tracking_overview.tsx - Modified LinkButton for downloading time spans to use the icon prop directly, simplifying the rendering.
frontend/.../task_list_view.tsx - Added icon prop to LinkButton for assignment and deletion actions, simplifying the JSX structure.
frontend/.../task_type_list_view.tsx - Updated LinkButton for deleting task types to use the icon prop directly, simplifying the JSX structure.
frontend/.../team_list_view.tsx - Simplified icon rendering in buttons by removing unnecessary class names for PlusOutlined, UserOutlined, and DeleteOutlined icons.
frontend/.../user_list_view.tsx - Consolidated icon rendering in LinkButton components by using the icon prop for user activation, deactivation, and annotations.

Suggested labels

bug

Suggested reviewers

  • philippotto
  • MichaelBuessemeyer

Poem

I’m hopping through the code, so light and free,
Swapping spans for buttons with a gleam of glee.
Icons twinkle like stars in a midnight sky,
A neat Space component arranges things just right.
Redundant wrappers vanish with a swift little nibble,
Coding joy, from this cheerful bunny, in every little scribble.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 4438279 and 97398bc.

📒 Files selected for processing (5)
  • frontend/javascripts/admin/statistic/time_tracking_overview.tsx (1 hunks)
  • frontend/javascripts/admin/task/task_list_view.tsx (2 hunks)
  • frontend/javascripts/admin/tasktype/task_type_list_view.tsx (1 hunks)
  • frontend/javascripts/admin/team/team_list_view.tsx (2 hunks)
  • frontend/javascripts/admin/user/user_list_view.tsx (4 hunks)
✅ Files skipped from review due to trivial changes (2)
  • frontend/javascripts/admin/statistic/time_tracking_overview.tsx
  • frontend/javascripts/admin/tasktype/task_type_list_view.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build
🔇 Additional comments (9)
frontend/javascripts/admin/task/task_list_view.tsx (2)

378-380: Icon implementation improved for consistent spacing

The icon implementation has been updated to use the icon prop instead of embedding the icon as a child element with a custom CSS class. This ensures consistent spacing through Ant Design's built-in styling.


399-401: Icon implementation improved for consistent spacing

The icon implementation has been updated to use the icon prop instead of embedding the icon as a child element with a custom CSS class. This enhances consistency with other action buttons in the interface.

frontend/javascripts/admin/team/team_list_view.tsx (3)

179-180: PlusOutlined icon styling cleaned up

The icon implementation has been cleaned up to remove the unnecessary class. This aligns with the PR's goal of improving icon spacing consistency.


236-239: Icon implementation improved for consistent spacing

The UserOutlined icon has been updated to use the icon prop, which ensures consistent spacing through Ant Design's built-in styling instead of relying on custom CSS classes.


242-244: Icon implementation improved for consistent spacing

The DeleteOutlined icon has been updated to use the icon prop, which ensures consistent spacing through Ant Design's built-in styling instead of relying on custom CSS classes.

frontend/javascripts/admin/user/user_list_view.tsx (4)

197-199: Icon implementation improved for consistent spacing

The UserAddOutlined icon has been updated to use the icon prop pattern, ensuring consistent spacing through Ant Design's built-in styling rather than custom CSS classes.


596-597: Icon implementation improved for consistent spacing

The UserOutlined icon has been updated to use the icon prop, which ensures consistent spacing through Ant Design's built-in styling mechanism.


606-609: Icon implementation improved for consistent spacing

The UserDeleteOutlined icon has been updated to use the icon prop pattern, ensuring consistent spacing through Ant Design's built-in styling.


617-620: Icon implementation improved for consistent spacing

The UserAddOutlined icon has been updated to use the icon prop, ensuring consistent spacing through Ant Design's built-in component styling.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 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.

</div>
) : (
<div>
<Space direction="vertical" size={1}>
Copy link
Member Author

Choose a reason for hiding this comment

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

IMHO this is cleaner than the <br> tags.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

muchas gracias!

@philippotto philippotto merged commit cfa4c42 into master Mar 18, 2025
3 checks passed
@philippotto philippotto deleted the fix-task-action-spacing branch March 18, 2025 08:00
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