Skip to content

[WIKI-519] regression: page creator and version info#7341

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix/page-owner
Jul 4, 2025
Merged

[WIKI-519] regression: page creator and version info#7341
sriramveeraghanta merged 1 commit intopreviewfrom
fix/page-owner

Conversation

@aaryan610
Copy link
Copy Markdown
Member

@aaryan610 aaryan610 commented Jul 4, 2025

Description

This PR fixes the following bugs-

  1. Incorrect page owner information.
  2. Incorrect version creator information.
  3. Page width calculation logic.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • New Features

    • The editor now displays a loading indicator within the document area while content is syncing.
    • Improved handling of wide and normal layout modes for the document editor.
  • Bug Fixes

    • Corrected which user is displayed as the creator in both the page information and version history panels.
  • Style

    • Enhanced and reorganized editor layout styles for better consistency and maintainability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 4, 2025

Walkthrough

The changes update how user ownership is determined in page and version info panels, switching from created_by to owned_by. Editor loading state handling is refactored, moving loader logic into the PageRenderer component with a new isLoading prop. CSS for editor layout is restructured for improved scoping and specificity.

Changes

File(s) Change Summary
apps/web/core/components/pages/navigation-pane/tab-panels/info/actors-info.tsx Switched user info source from created_by to owned_by for page creator details.
apps/web/core/components/pages/navigation-pane/tab-panels/info/version-history.tsx Changed version creator info to use owned_by instead of created_by.
packages/editor/src/core/components/editors/document/collaborative-editor.tsx Refactored loading logic: removed loader import and conditional, always renders PageRenderer with isLoading.
packages/editor/src/core/components/editors/document/page-renderer.tsx Added optional isLoading prop; renders loader when true; updated layout class logic.
packages/editor/src/styles/variables.css Restructured editor layout styles under .frame-renderer; updated selector specificity and padding/margin rules.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CollaborativeEditor
    participant PageRenderer

    User->>CollaborativeEditor: Open document
    CollaborativeEditor->>PageRenderer: Render with isLoading = true/false
    alt isLoading = true
        PageRenderer->>PageRenderer: Render DocumentContentLoader
    else isLoading = false
        PageRenderer->>PageRenderer: Render editor content
    end
Loading

Suggested labels

ready to merge

Suggested reviewers

  • prateekshourya29
  • sriramveeraghanta

Poem

A hop and a skip in the editor’s den,
Ownership now clear—no guessing again!
The loader has moved, the layout refined,
With .frame-renderer styles now neatly aligned.
Rabbits rejoice as the code takes a leap—
These tidy improvements are ours to keep! 🐇✨


📜 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 ba884d1 and 08383e8.

📒 Files selected for processing (5)
  • apps/web/core/components/pages/navigation-pane/tab-panels/info/actors-info.tsx (1 hunks)
  • apps/web/core/components/pages/navigation-pane/tab-panels/info/version-history.tsx (1 hunks)
  • packages/editor/src/core/components/editors/document/collaborative-editor.tsx (2 hunks)
  • packages/editor/src/core/components/editors/document/page-renderer.tsx (2 hunks)
  • packages/editor/src/styles/variables.css (4 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/editor/src/core/components/editors/document/page-renderer.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
packages/editor/src/core/components/editors/document/collaborative-editor.tsx (2)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
packages/editor/src/styles/variables.css (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (10)
apps/web/core/components/pages/navigation-pane/tab-panels/info/version-history.tsx (1)

37-37: LGTM: Correctly fixes version creator information

The change from version.created_by to version.owned_by properly addresses the incorrect version creator information issue mentioned in the PR objectives. This ensures the correct user details are displayed for version ownership.

apps/web/core/components/pages/navigation-pane/tab-panels/info/actors-info.tsx (1)

24-26: LGTM: Correctly switches to owned_by for user details

The changes to use owned_by instead of created_by for extracting and fetching user details align with the PR objective of fixing incorrect page owner information.

packages/editor/src/core/components/editors/document/page-renderer.tsx (3)

17-17: Good addition of optional loading prop.

The isLoading prop is properly typed as optional, maintaining backward compatibility while enabling centralized loading state handling.


26-30: Excellent CSS class structure for layout management.

The use of cn utility with conditional wide-layout class provides clean, maintainable layout switching. The frame-renderer class aligns perfectly with the CSS restructuring in variables.css.


31-49: Well-structured conditional rendering for loading states.

The loading state logic is clean and centralizes what was previously scattered across different components. The conditional rendering properly handles both loading and ready states while maintaining all existing functionality.

packages/editor/src/core/components/editors/document/collaborative-editor.tsx (2)

6-6: Appropriate import cleanup.

Removing the DocumentContentLoader import is correct since loading state is now handled internally by PageRenderer.


93-93: Correct loading state logic.

The loading condition !hasServerSynced && !hasServerConnectionFailed properly indicates when the editor should show a loading state - when the server hasn't synchronized yet but the connection hasn't failed.

packages/editor/src/styles/variables.css (3)

173-179: Excellent CSS scoping improvement.

Moving the --editor-content-width variable and wide-layout modifier to .frame-renderer provides better scoping and aligns perfectly with the component structure changes. This improves maintainability and reduces CSS specificity conflicts.


180-200: Well-structured selector organization.

The reorganization of selectors under .frame-renderer provides consistent scoping while maintaining the existing layout behavior. The margin property unification (margin-left: auto !important; margin-right: auto !important) ensures proper centering.


229-255: Consistent container query updates.

The container query rules are properly updated to target .frame-renderer scoped selectors, maintaining responsive behavior while working with the new CSS structure. The specificity under #page-content-container ensures proper style application.

✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@makeplane
Copy link
Copy Markdown

makeplane bot commented Jul 4, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

@aaryan610 aaryan610 changed the title [WIKI-400] regression: page creator and version info [WIKI-519] regression: page creator and version info Jul 4, 2025
@sriramveeraghanta sriramveeraghanta merged commit b909416 into preview Jul 4, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/page-owner branch July 4, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants