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(native-app): app update inbox UI #15091

Merged
merged 9 commits into from
Jun 10, 2024
Merged

feat(native-app): app update inbox UI #15091

merged 9 commits into from
Jun 10, 2024

Conversation

thoreyjona
Copy link
Contributor

@thoreyjona thoreyjona commented Jun 4, 2024

What

Update UI of inbox and document-detail to match new design.

Screenshots / Gifs

Next up in a separate PR:

  • Use new endpoints
  • Use unreadCount variable from server

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Introduced DEFAULT_PAGE_SIZE for better pagination control.
    • Enhanced ListItem component to support new icon types and improved styling.
  • Bug Fixes

    • Simplified underlayColor logic for consistent visual feedback in NotificationCard.
    • Improved logo URL handling by ensuring proper URL format.
  • Style

    • Updated styling in various components for a more consistent and modern look.
    • Replaced outdated components with Typography for better text handling.
  • Refactor

    • Removed unnecessary constants and imports to streamline code.
    • Refactored components for better readability and maintainability.

@thoreyjona thoreyjona requested a review from a team as a code owner June 4, 2024 15:00
Copy link
Contributor

coderabbitai bot commented Jun 4, 2024

Walkthrough

The updates revolve around enhancing the user interface and logic of various components within the app. Key changes include updating constants and props in the inbox and notifications screens, refining URL handling in the organizations store, and improving the styling and structure of UI components like notification cards, headers, and list items. These modifications aim to streamline the codebase, enhance visual feedback, and ensure consistent styling across the application.

Changes

Files/Paths Change Summary
.../screens/inbox/inbox.tsx Added constants, updated props, removed unused constants, and adjusted component structure.
.../screens/notifications/notifications.tsx Removed underlayColor prop affecting touchable component feedback.
.../stores/organizations-store.ts Updated logo URL setting logic in organizationsStore function.
.../ui/lib/card/notification-card.tsx Simplified underlayColor logic in NotificationCard component.
.../ui/lib/detail/header.tsx Updated imports, styling, and component structure; replaced custom components with Typography.
.../ui/lib/list/list-item.tsx Modified imports, styling, and ListItem component structure; updated icon prop type.
.../ui/lib/skeleton/list-item-skeleton.tsx Adjusted styling properties and refactored structure within ListItemSkeleton function.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@datadog-island-is
Copy link

Datadog Report

Branch report: feat/app-update-inbox
Commit report: c969e5e
Test service: api

✅ 0 Failed, 4 Passed, 0 Skipped, 3.37s Total Time
➡️ Test Sessions change in coverage: 1 no change

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.13%. Comparing base (cd01b30) to head (5190cac).
Report is 112 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15091      +/-   ##
==========================================
- Coverage   37.13%   37.13%   -0.01%     
==========================================
  Files        6389     6389              
  Lines      130008   130009       +1     
  Branches    37082    37082              
==========================================
  Hits        48274    48274              
- Misses      81734    81735       +1     
Flag Coverage Δ
api 3.44% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd01b30...5190cac. Read the comment docs.

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

Outside diff range and nitpick comments (1)
apps/native/app/src/ui/lib/skeleton/list-item-skeleton.tsx (1)

Line range hint 56-56: Rename the Date styled component to avoid shadowing the global Date object, which can lead to confusion and potential bugs.

- const Date = styled.View`
+ const DateView = styled.View`
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8bdf391 and 5190cac.

Files selected for processing (7)
  • apps/native/app/src/screens/inbox/inbox.tsx (5 hunks)
  • apps/native/app/src/screens/notifications/notifications.tsx (1 hunks)
  • apps/native/app/src/stores/organizations-store.ts (1 hunks)
  • apps/native/app/src/ui/lib/card/notification-card.tsx (1 hunks)
  • apps/native/app/src/ui/lib/detail/header.tsx (3 hunks)
  • apps/native/app/src/ui/lib/list/list-item.tsx (3 hunks)
  • apps/native/app/src/ui/lib/skeleton/list-item-skeleton.tsx (4 hunks)
Files not reviewed due to errors (5)
  • apps/native/app/src/ui/lib/detail/header.tsx (no review received)
  • apps/native/app/src/stores/organizations-store.ts (no review received)
  • apps/native/app/src/ui/lib/list/list-item.tsx (no review received)
  • apps/native/app/src/screens/notifications/notifications.tsx (no review received)
  • apps/native/app/src/screens/inbox/inbox.tsx (no review received)
Files skipped from review due to trivial changes (1)
  • apps/native/app/src/ui/lib/card/notification-card.tsx
Additional context used
Path-based instructions (6)
apps/native/app/src/ui/lib/skeleton/list-item-skeleton.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/ui/lib/detail/header.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/stores/organizations-store.ts (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/ui/lib/list/list-item.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/notifications/notifications.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/src/screens/inbox/inbox.tsx (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
Biome
apps/native/app/src/ui/lib/skeleton/list-item-skeleton.tsx

[error] 56-56: Do not shadow the global "Date" property. (lint/suspicious/noShadowRestrictedNames)

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

apps/native/app/src/stores/organizations-store.ts

[error] 33-33: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 91-91: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 97-98: Avoid the delete operator which can impact performance. (lint/performance/noDelete)

Unsafe fix: Use an undefined assignment instead.

apps/native/app/src/screens/notifications/notifications.tsx

[error] 98-114: Prefer for...of instead of forEach. (lint/complexity/noForEach)

forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.


[error] 129-129: This hook does not specify all of its dependencies: markAllUserNotificationsAsSeen (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.

Either include it or remove the dependency array


[error] 129-129: This hook does not specify all of its dependencies: updateNavigationUnseenCount (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.

Either include it or remove the dependency array


[error] 147-147: This hook does not specify all of its dependencies: componentId (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.

Either include it or remove the dependency array


[error] 147-147: This hook does not specify all of its dependencies: markUserNotificationAsRead (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.

Either include it or remove the dependency array


[error] 239-239: This hook specifies more dependencies than necessary: memoizedData (lint/correctness/useExhaustiveDependencies)

This dependency can be removed from the list.

apps/native/app/src/screens/inbox/inbox.tsx

[error] 63-63: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 95-95: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 337-337: Unexpected any. Specify a different type. (lint/suspicious/noExplicitAny)

any disables many type checking rules. Its use should be avoided.


[error] 50-50: Shouldn't redeclare 'ListItem'. Consider to delete it or rename it. (lint/suspicious/noRedeclare)

'ListItem' is defined here:


[error] 198-198: This hook specifies more dependencies than necessary: filters (lint/correctness/useExhaustiveDependencies)

This dependency can be removed from the list.


[error] 204-204: This hook does not specify all of its dependencies: data?.totalCount (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.


[error] 204-204: This hook does not specify all of its dependencies: pageSize (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.

This dependency is not specified in the hook dependency list.

This dependency is not specified in the hook dependency list.


[error] 204-204: This hook does not specify all of its dependencies: getListDocument (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.


[error] 204-204: This hook specifies more dependencies than necessary: refetcher (lint/correctness/useExhaustiveDependencies)

This dependency can be removed from the list.


[error] 307-307: This hook specifies more dependencies than necessary: res.refetching (lint/correctness/useExhaustiveDependencies)

This dependency can be removed from the list.


[error] 311-311: This hook does not specify all of its dependencies: res.refetch (lint/correctness/useExhaustiveDependencies)

This dependency is not specified in the hook dependency list.


[error] 311-311: This hook specifies more dependencies than necessary: refresh (lint/correctness/useExhaustiveDependencies)

Outer scope values aren't valid dependencies because mutating them doesn't re-render the component.

Additional comments not posted (3)
apps/native/app/src/ui/lib/skeleton/list-item-skeleton.tsx (3)

9-16: LGTM! The dynamic theming for borders and colors in the Host component enhances UI consistency across different themes.


25-28: The adjustments to the Circle component's dimensions and margins align well with the updated design specifications.


40-42: The updated padding and margin in the Content component improve spacing and visual consistency.

Copy link
Member

@eirikurn eirikurn left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@thoreyjona thoreyjona added the automerge Merge this PR as soon as all checks pass label Jun 10, 2024
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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5190cac and 6d639ea.

Files selected for processing (1)
  • apps/native/app/src/screens/notifications/notifications.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/native/app/src/screens/notifications/notifications.tsx

@kodiakhq kodiakhq bot merged commit 0b2f492 into main Jun 10, 2024
42 checks passed
@kodiakhq kodiakhq bot deleted the feat/app-update-inbox branch June 10, 2024 11:29
sigruntg pushed a commit that referenced this pull request Jun 12, 2024
* feat: update UI for inbox

* feat: update header in document-detail

* feat: set same underlay color for both notifications and inbox for both light and dark mode

* feat: add const for default page size for inbox

* fix: icon for orgs in inbox on dev

* feat: make icon bigger

* feat: use unreadCount from server

* fix: undoing changes on unreadCount variable since it changes with the filter

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
lodmfjord pushed a commit that referenced this pull request Jun 14, 2024
* feat: update UI for inbox

* feat: update header in document-detail

* feat: set same underlay color for both notifications and inbox for both light and dark mode

* feat: add const for default page size for inbox

* fix: icon for orgs in inbox on dev

* feat: make icon bigger

* feat: use unreadCount from server

* fix: undoing changes on unreadCount variable since it changes with the filter

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants