Skip to content

[WEB-3759]chore: updated module and pages detail header#6903

Merged
pushya22 merged 2 commits intopreviewfrom
chore-header_revamp
Apr 9, 2025
Merged

[WEB-3759]chore: updated module and pages detail header#6903
pushya22 merged 2 commits intopreviewfrom
chore-header_revamp

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Apr 9, 2025

Description

Updated toggle module sidebar button. Added quick actions menu for header.
Updated switcher for pages added icons for indicating public, private or archived.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

WEB-3759

Summary by CodeRabbit

  • New Features

    • Introduced a quick actions panel in the module header for more intuitive controls.
    • Added visual access indicators in the page header to clearly denote page statuses (e.g., archived, public, or restricted).
  • Enhancements

    • Refined button styling and icon displays for a cleaner, more cohesive user interface.
    • Updated page link layouts to seamlessly incorporate access status visuals.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

The changes update two header components in the web application. In the module header, an unused dropdown option is removed, and a new quick actions component is incorporated with adjusted imports and styling. In the page header, a new access icon component is introduced to display specific icons based on the page’s archived status and access level. Button classes and icon display logic have been modified to better reflect the intended UI improvements.

Changes

File Change Summary
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx Updated imports (added useRef, removed ArrowRight, added ModuleQuickActions), removed ModuleDropdownOption, integrated ModuleQuickActions with specific props, and revised button styling and icon classes.
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx Introduced a new PageAccessIcon component to dynamically show icons (Archive, Earth, or Lock) based on page status; modified the page link structure to include the access icon and updated the icon for CustomSearchSelect from Layers to FileText.

Sequence Diagram(s)

sequenceDiagram
  participant UI
  participant MIH as ModuleIssuesHeader
  participant MQA as ModuleQuickActions

  UI->>MIH: Render module header
  MIH->>MQA: Invoke ModuleQuickActions with props
  MQA-->>MIH: Return rendered quick actions
  MIH->>UI: Render updated header view
Loading
sequenceDiagram
  participant UI
  participant PH as PageHeader
  participant PAI as PageAccessIcon

  UI->>PH: Render page header
  PH->>PAI: Request icon based on page data
  PAI->>PAI: Determine archived status and access level
  PAI-->>PH: Return corresponding icon (Archive, Earth, or Lock)
  PH->>UI: Render page link with access icon
Loading

Possibly related PRs

  • makeplane/plane#6875: Involves similar modifications to a quick actions component in the module area, aligning with structural enhancements in this PR.

Suggested labels

🌐frontend

Suggested reviewers

  • aaryan610
  • prateekshourya29
  • sriramveeraghanta

Poem

I'm a hopping rabbit, fresh and bright,
Coding changes making the UI light.
Quick actions and icons now prance with glee,
In our code garden, wild and free.
With a twitch of my nose, I celebrate these updates! 🐰

Hop on, let's bounce into cleaner code!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, 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.

@makeplane
Copy link

makeplane bot commented Apr 9, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@vamsikrishnamathala vamsikrishnamathala changed the title [WEB-3759]chore: updated module detail header [WEB-3759]chore: updated module and pages detail header Apr 9, 2025
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

🧹 Nitpick comments (2)
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx (1)

23-33: Consider type-safety improvement for PageAccessIcon component.

The component accepts the entire page object but should properly define its props interface for better type safety.

-const PageAccessIcon = (page: TPage) => (
+interface PageAccessIconProps {
+  archived_at?: string | null;
+  access: EPageAccess;
+}
+
+const PageAccessIcon = ({ archived_at, access }: PageAccessIconProps) => (
  <div>
-    {page.archived_at ? (
+    {archived_at ? (
      <ArchiveIcon className="h-2.5 w-2.5 text-custom-text-300" />
-    ) : page.access === EPageAccess.PUBLIC ? (
+    ) : access === EPageAccess.PUBLIC ? (
      <Earth className="h-2.5 w-2.5 text-custom-text-300" />
    ) : (
      <Lock className="h-2.5 w-2.5 text-custom-text-300" />
    )}
  </div>
);
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (1)

307-313: Standardize size utility in customClassName.

The size-6 utility in the customClassName might not be standard Tailwind CSS. Consider using w-6 h-6 for better compatibility.

-            customClassName="flex-shrink-0 flex items-center justify-center size-6 bg-custom-background-80/70 rounded"
+            customClassName="flex-shrink-0 flex items-center justify-center w-6 h-6 bg-custom-background-80/70 rounded"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 993c789 and 5e0bbcf.

📒 Files selected for processing (2)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (4 hunks)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx (4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (2)
web/core/components/modules/quick-actions.tsx (1)
  • ModuleQuickActions (30-210)
web/core/store/router.store.ts (2)
  • projectId (85-87)
  • workspaceSlug (69-71)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (10)
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(detail)/header.tsx (4)

5-5: Good choice of icons for the various access states.

The selection of Earth, Lock, and ArchiveIcon are intuitive visual indicators for public, private, and archived pages respectively.


7-8: Good addition of the EPageAccess import.

Adding the EPageAccess enum from constants is a proper way to handle the access level comparison rather than using string literals.


62-67: Good UI enhancement with the access icon.

The layout of the page link with access indicator improves user experience by clearly showing the page status at a glance.


113-113: Consistent icon usage.

Using FileText icon consistently for page-related UI elements improves visual coherence.

web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx (6)

3-3: Added necessary useRef import.

Correctly added useRef import to support the new ModuleQuickActions implementation.


8-8: Streamlined imports.

Removed unused ArrowRight icon to keep imports clean and relevant.


32-32: Added ModuleQuickActions component.

The addition of ModuleQuickActions will enhance functionality with a comprehensive set of module management options.


55-56: Added needed ref for context menu.

The parentRef will properly position the context menu relative to its parent element.


302-302: Improved button styling.

Added background color to provide better visual feedback for the toggle sidebar button.


305-305: Simplified icon styling.

Simplified the conditional styling for the PanelRight icon for better maintainability.

Comment on lines +307 to +313
<ModuleQuickActions
parentRef={parentRef}
moduleId={moduleId?.toString()}
projectId={projectId.toString()}
workspaceSlug={workspaceSlug.toString()}
customClassName="flex-shrink-0 flex items-center justify-center size-6 bg-custom-background-80/70 rounded"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify whether parentRef is being correctly applied.

The ModuleQuickActions component is correctly implemented, but I don't see where the parentRef is attached to a DOM element in the component.


🏁 Script executed:

#!/bin/bash
# Check if parentRef is used elsewhere in the component

# First, let's look for any div with ref={parentRef} in this file
rg -A 2 -B 2 "ref={parentRef}" "web/app/\[workspaceSlug\]/(projects)/projects/(detail)/\[projectId\]/modules/(detail)/header.tsx" || echo "No explicit ref assignment found"

# Let's also check how ModuleQuickActions uses parentRef in the component implementation
rg -A 5 "const { parentRef" "web/core/components/modules/quick-actions.tsx" || echo "parentRef usage not found in quick-actions.tsx"

Length of output: 596


Action Required: Attach the Parent Reference

After verifying the code in both the header file and the ModuleQuickActions component, it appears that the parentRef prop is passed correctly to the ModuleQuickActions component but is not being attached to any DOM element—neither in the header file nor within the component implementation.

  • Header File (web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/modules/(detail)/header.tsx):
    The parentRef is passed as a prop but no DOM element has a ref={parentRef} assignment.

  • ModuleQuickActions Component (web/core/components/modules/quick-actions.tsx):
    A search for a parentRef assignment in the component did not reveal any explicit usage, indicating that the ref is not attached to any DOM element within this component.

Recommendation:
Either update the ModuleQuickActions component to assign parentRef to a relevant DOM element (e.g., a top-level <div ref={parentRef}>) if it is needed for functionality, or remove it from the props if it is no longer required.

@pushya22 pushya22 merged commit 14914e8 into preview Apr 9, 2025
5 of 6 checks passed
@pushya22 pushya22 deleted the chore-header_revamp branch April 9, 2025 14:06
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* chore: added panel collapse and quick action menu for module detail header

* fix: updated pages header swithcer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🌟improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants