Skip to content

[Improvement] Update Broken UI for "Employee/Team" Column in Project List View (#8539) #8898

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

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

samuelmbabhazi
Copy link
Contributor

@samuelmbabhazi samuelmbabhazi commented Apr 4, 2025

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


@samuelmbabhazi samuelmbabhazi self-assigned this Apr 4, 2025
Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

Summary by CodeRabbit

  • New Features

    • The employee display has been simplified to show up to five avatars with a clear counter for any additional employees.
  • Style

    • Updated visual layout enhances alignment and hover interactions for a more intuitive user interface.

Walkthrough

The changes streamline the employee display in the UI component. The template now iterates directly over a new displayedEmployees list, including a conditional block to show a count for employees exceeding a set limit. The component’s logic is modified with a new initializeEmployees method that limits displayed entries to five and computes a remaining count, replacing the previous grouping approach. In addition, the SCSS file is updated to adjust the avatar group's layout and introduce a new .remaining-count style.

Changes

File(s) Summary of Changes
packages/ui-core/.../employee-with-links.component.html
packages/ui-core/.../employee-with-links.component.ts
Refactored display logic: removed nested grouping in the HTML template; updated TS to use displayedEmployees, added maxDisplay (set to 5) and remainingCount, and renamed initializeGrouping to initializeEmployees.
packages/ui-core/.../employee-with-links.component.scss Updated styling: removed position from .avatar-group, changed alignment from center to flex-start, refined hover stacking for .avatar, and added a new .remaining-count class with comprehensive styling.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Template/UI
    participant C as EmployeeWithLinksComponent
    participant Data as Employee Data

    Data->>C: Provide employee list (value input)
    C-->>C: Call initializeEmployees()
    C->>C: Select up to 5 employees into displayedEmployees
    C->>C: Calculate remainingCount for extra employees
    C->>UI: Render avatar group with displayedEmployees
    alt remainingCount > 0
        C->>UI: Render extra count element
    end
Loading

Poem

I'm a hopping rabbit on a coding spree,
Skipping through changes light and free,
With avatars lined in a tidy row,
And extra counts that brightly glow,
My code garden blooms with every tweak,
Hoppy changes make my heart skip a beat!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
warning Lockfile has incorrect entry for "[email protected]". Ignoring it.
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
info There appears to be trouble with the npm registry (returned undefined). Retrying...
/opt/yarn-v1.22.22/lib/cli.js:66663
throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode);
^

ResponseError: Request failed "503 Service Unavailable"
at ResponseError.ExtendableBuiltin (/opt/yarn-v1.22.22/lib/cli.js:696:66)
at new ResponseError (/opt/yarn-v1.22.22/lib/cli.js:802:124)
at params.callback [as _callback] (/opt/yarn-v1.22.22/lib/cli.js:66663:19)
at self.callback (/opt/yarn-v1.22.22/lib/cli.js:141415:22)
at Request.emit (node:events:519:28)
at Request. (/opt/yarn-v1.22.22/lib/cli.js:142387:10)
at Request.emit (node:events:519:28)
at IncomingMessage. (/opt/yarn-v1.22.22/lib/cli.js:142309:12)
at Object.onceWrapper (node:events:633:28)
at IncomingMessage.emit (node:events:531:35) {
responseCode: 503
}

Node.js v22.9.0


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e4b60ca and e521c8b.

📒 Files selected for processing (1)
  • packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: test
  • GitHub Check: build
🔇 Additional comments (4)
packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (4)

15-17: Good adoption of typed properties for clarity.

Using IEmployee[] for displayedEmployees is a good move. Specifying the types for maxDisplay and remainingCount remains optional in TypeScript since they are trivially inferred; leveraging type inference keeps the code concise.


22-22: Nice initialization approach.

Calling initializeEmployees() in ngOnInit() properly aligns with Angular’s lifecycle, ensuring the component’s display logic is ready when rendered.


26-27: Doc comment is consistent with the code logic.

The mention of “max 5” correctly reflects the current maxDisplay value and aids maintainability. No issues found.


31-43: Clean and straightforward initialization logic.

The conditional checks for this.value and use of slice to limit displayed employees offer a well-structured solution. This approach gracefully handles non-array inputs and large arrays, simplifying the displayed list and properly calculating remainingCount.

✨ 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 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

nx-cloud bot commented Apr 4, 2025

View your CI Pipeline Execution ↗ for commit e521c8b.

Command Status Duration Result
nx build gauzy -c=production --prod --verbose ✅ Succeeded 8m 12s View ↗
nx build desktop --base-href ./ ✅ Succeeded 1m 43s View ↗
nx build desktop-api --output-path=dist/apps/de... ✅ Succeeded 27s View ↗
nx run api:desktop-api ✅ Succeeded 1m 19s View ↗
nx run gauzy:desktop-ui --base-href ./ ✅ Succeeded 3m 47s View ↗
nx build api -c=production --prod ✅ Succeeded 1m 17s View ↗
nx build desktop-ui-lib --configuration=develop... ✅ Succeeded 31s View ↗
nx build plugin-integration-wakatime ✅ Succeeded <1s View ↗
Additional runs (57) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-04-06 16:05:22 UTC

@samuelmbabhazi
Copy link
Contributor Author

Capture d’écran du 2025-04-04 20-11-44

@samuelmbabhazi samuelmbabhazi marked this pull request as ready for review April 5, 2025 09:01
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here: https://app.greptile.com/review/github.

💡 (5/5) You can turn off certain types of comments like style here!

3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 765ba57 and 277ee91.

📒 Files selected for processing (3)
  • packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.html (1 hunks)
  • packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.scss (3 hunks)
  • packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts

[error] 16-16: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)


[error] 17-17: This type annotation is trivially inferred from its initialization.

Safe fix: Remove the type annotation.

(lint/style/noInferrableTypes)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (8)
packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.html (1)

2-26: Improved employee list display implementation

The HTML structure has been simplified by directly iterating over displayedEmployees instead of using nested containers with groups. The addition of the remaining count indicator provides better user experience by showing when there are more employees than can be displayed.

packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.scss (4)

16-16: Improved alignment with flex-start

Changing from center to flex-start improves the alignment of the avatars, providing a more natural left-to-right reading flow.


43-43: Enhanced hover behavior with z-index

Adding z-index to the avatar hover state ensures the expanded text remains visible over other elements.


47-66: Well-implemented remaining count indicator styling

The styling for the remaining count indicator is comprehensive and visually consistent with the avatar elements, while ensuring it stands out appropriately with the blue background.


81-81: Fixed selector syntax

Corrected the CSS selector syntax for adjacent avatar elements.

packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (3)

22-22: Updated initialization method call

Method call correctly updated to match the new method name.


26-28: Updated documentation to reflect new implementation

The JSDoc comments have been updated to accurately describe the new functionality that limits displayed employees and calculates remaining count.


31-42: Improved employee display logic with limit and overflow indication

The new implementation is more straightforward and user-friendly:

  1. Limits displayed employees to a maximum of 5
  2. Calculates and stores the count of remaining employees
  3. Properly handles edge cases (null/non-array values and small arrays)

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 277ee91 and e4b60ca.

📒 Files selected for processing (1)
  • packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: test
  • GitHub Check: build
🔇 Additional comments (1)
packages/ui-core/shared/src/lib/table-components/employee-with-links/employee-with-links.component.ts (1)

31-43: Implementation logic looks good.

This approach correctly slices the array to display only the maximum allowed number of employees and calculates the remaining count, aligning with the specified UI requirements.

@evereq
Copy link
Member

evereq commented Apr 6, 2025

@samuelmbabhazi hm, why you removed grouping of employees for 3 in one row? I think it was done to make sure it's more visible compared to how you did it - all in one row. Did you understand what was that grouping for before remove!?

@evereq evereq marked this pull request as draft April 6, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Update broken UI for "Employee/Team" column value in Project List View
2 participants