Skip to content

[WEB-5350] migration: navigation#8156

Merged
sriramveeraghanta merged 6 commits intopreviewfrom
migration-navigation-revamp
Nov 21, 2025
Merged

[WEB-5350] migration: navigation#8156
sriramveeraghanta merged 6 commits intopreviewfrom
migration-navigation-revamp

Conversation

@sangeethailango
Copy link
Member

@sangeethailango sangeethailango commented Nov 21, 2025

Description

Added new fields related to navigation.

Type of Change

  • Feature (non-breaking change which adds functionality)

Summary by CodeRabbit

  • New Features
    • Users can choose their navigation layout: Accordion or Tabbed view.
    • Workspace settings now include a configurable project display limit in navigation (default 10).

✏️ Tip: You can customize this high-level summary in your review settings.

@sangeethailango sangeethailango marked this pull request as ready for review November 21, 2025 10:58
@cursor
Copy link

cursor bot commented Nov 21, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Walkthrough

Two new fields were added to WorkspaceUserProperties: navigation_project_limit (IntegerField, default 10) and navigation_control_preference (CharField with choices ACCORDION or TABBED, default ACCORDION). A Django migration was added to create these columns.

Changes

Cohort / File(s) Summary
Model addition
apps/api/plane/db/models/workspace.py
Adds inner NavigationControlPreference TextChoices with ACCORDION and TABBED; adds navigation_project_limit (IntegerField, default=10) and navigation_control_preference (CharField, max_length=25, choices, default=ACCORDION) to WorkspaceUserProperties.
Database migration
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py
New migration with two AddField operations to create navigation_control_preference (CharField, max_length=25, default=ACCORDION, choices) and navigation_project_limit (IntegerField, default=10). Depends on migration 0109_issuecomment_description_and_parent_id.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review: apps/api/plane/db/models/workspace.py for correct TextChoices naming, choice labels, and default.
  • Review: migration file for correct dependencies, defaults, and consistency with the model.

Poem

🐰 I hopped through code with a nibble and grin,
Two tiny fields tucked neatly within,
Accordion folds or tabs to explore,
Ten projects waiting behind every door,
A little rabbit cheers: configure and win!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is incomplete. It lacks details about what navigation fields were added, why they were added, and how they function. Required sections like Test Scenarios and References are missing. Expand the description to detail the new navigation_control_preference and navigation_project_limit fields, include test scenarios demonstrating their functionality, and add the WEB-5350 issue reference.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a database migration for navigation-related fields to WorkspaceUserProperties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch migration-navigation-revamp

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sangeethailango sangeethailango changed the title migration: navigation [WEB-5350] migration: navigation Nov 21, 2025
@makeplane
Copy link

makeplane bot commented Nov 21, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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

🧹 Nitpick comments (1)
apps/api/plane/db/models/workspace.py (1)

318-318: Consider using PositiveIntegerField for num_of_projects.

Since num_of_projects represents a count, it should likely be constrained to non-negative values. Using IntegerField allows negative values, which may not be semantically valid.

Apply this diff to use PositiveIntegerField:

-    num_of_projects = models.IntegerField(default=10)
+    num_of_projects = models.PositiveIntegerField(default=10)

Additionally, consider adding help_text to clarify what this field represents (e.g., "Number of projects to display in navigation").

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5cfb953 and 90c2e32.

📒 Files selected for processing (2)
  • apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1 hunks)
  • apps/api/plane/db/models/workspace.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/api/plane/db/models/workspace.py (1)
apps/api/plane/utils/exporters/schemas/base.py (1)
  • BooleanField (97-105)
apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1)
apps/api/plane/utils/exporters/schemas/base.py (1)
  • BooleanField (97-105)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/api/plane/db/models/workspace.py (1)

319-319: LGTM! Navigation preference field is well-defined.

The is_horizontal_navigation_bar field uses an appropriate type and default for storing user navigation preferences.

Consider adding help_text (e.g., "Whether to display horizontal navigation bar") for better documentation if this is a pattern followed elsewhere in the codebase.

apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1)

24-33: Migration is consistent with model definition.

The migration operations correctly add both is_horizontal_navigation_bar and num_of_projects fields with types and defaults that match the model definition. Since both fields have defaults, existing rows will be safely updated without requiring backfills.

Note: If you apply the PositiveIntegerField suggestion from the model review, remember to update line 32 in this migration accordingly.

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 (1)
apps/api/plane/db/models/workspace.py (1)

322-322: Consider adding validation constraints for project limit.

The navigation_project_limit field currently accepts any integer value, including negative numbers or unreasonably large values. Consider adding validators to ensure the value is within a reasonable range.

Example with validation:

from django.core.validators import MinValueValidator, MaxValueValidator

navigation_project_limit = models.IntegerField(
    default=10,
    validators=[MinValueValidator(1), MaxValueValidator(100)]
)

Adjust the min/max values based on your business requirements.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90c2e32 and a08037e.

📒 Files selected for processing (2)
  • apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1 hunks)
  • apps/api/plane/db/models/workspace.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/db/models/workspace.py (1)

323-327: Field implementation looks good once spelling is corrected.

The navigation_control_preference field is properly structured with appropriate max_length and default value. Once the spelling error in NavigationControlPreference.ACCORDIAN is fixed (see previous comment), this field will be ready.

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 (1)
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1)

18-22: Verify the default limit and consider adding validation.

The default value of 10 for the project limit appears reasonable, but please confirm this aligns with product requirements. Additionally, consider adding validation constraints to ensure data integrity (e.g., positive values only).

If you'd like to add validation, you can apply this diff:

+from django.core.validators import MinValueValidator
+
...
         migrations.AddField(
             model_name='workspaceuserproperties',
             name='navigation_project_limit',
-            field=models.IntegerField(default=10),
+            field=models.IntegerField(default=10, validators=[MinValueValidator(1)]),
         ),

Note: You'll also need to update the model definition in apps/api/plane/db/models/workspace.py to include the same validator.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d12c201 and e25c3b9.

📒 Files selected for processing (2)
  • apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1 hunks)
  • apps/api/plane/db/models/workspace.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/api/plane/db/models/workspace.py
🧰 Additional context used
🧬 Code graph analysis (1)
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1)
apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1)
  • Migration (7-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1)

1-10: LGTM!

Migration structure and dependencies are correctly defined.

@dheeru0198 dheeru0198 added 🔄migrations Contains Migration changes ready to merge labels Nov 21, 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: 0

🧹 Nitpick comments (1)
apps/api/plane/db/models/workspace.py (1)

304-307: Navigation preference enum and fields are consistent; consider validating the limit.

NavigationControlPreference and navigation_control_preference are wired correctly (choices + default) and align with the new navigation_project_limit field; schema looks good and matches the described behavior.

If navigation_project_limit should never be zero/negative, consider tightening it with PositiveIntegerField or a MinValueValidator(1) to prevent bad data sneaking in from API/admin usage.

Also applies to: 322-327

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e25c3b9 and 94772e5.

📒 Files selected for processing (2)
  • apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1 hunks)
  • apps/api/plane/db/models/workspace.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1)
apps/api/plane/db/migrations/0109_issuecomment_description_and_parent_id.py (1)
  • Migration (7-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/api/plane/db/migrations/0110_workspaceuserproperties_navigation_control_preference_and_more.py (1)

1-23: Migration matches model schema and defaults.

The added fields, choices, and defaults are in sync with WorkspaceUserProperties in workspace.py, and the dependency chain looks correct for applying this as a straightforward schema migration.

@sriramveeraghanta sriramveeraghanta merged commit ba4e711 into preview Nov 21, 2025
7 of 9 checks passed
@sriramveeraghanta sriramveeraghanta deleted the migration-navigation-revamp branch November 21, 2025 15:21
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* migration: navigation related fields in workspace_user_properties

* fix: field names

* fix: remove max_length

* fix: create new migration

* fix: typo

* Renamed horizontal preference to tabbed

---------

Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* migration: navigation related fields in workspace_user_properties

* fix: field names

* fix: remove max_length

* fix: create new migration

* fix: typo

* Renamed horizontal preference to tabbed

---------

Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* migration: navigation related fields in workspace_user_properties

* fix: field names

* fix: remove max_length

* fix: create new migration

* fix: typo

* Renamed horizontal preference to tabbed

---------

Co-authored-by: Dheeraj Kumar Ketireddy <dheeru0198@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔄migrations Contains Migration changes ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants