Skip to content

Conversation

@TaranaKhanna
Copy link
Contributor

@TaranaKhanna TaranaKhanna commented Dec 6, 2025

fixes: #1510

2025-12-06.11-53-23.mp4

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a modal dialog with title input (featuring validation and enter-key submit), description field, and submit button.
    • Implemented permission-based access control to restrict creation capabilities.
    • Posts automatically redirect to their detail page upon creation.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'path_filters'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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
📝 Walkthrough

Walkthrough

This change adds a Create Post feature to the homepage through a modal dialog. A "Submit Feedback" button toggles the dialog, which contains form inputs for title and description, validation logic, and a submit workflow that creates the post and navigates to the result.

Changes

Cohort / File(s) Summary
Homepage Create Post Feature
packages/theme/src/pages/Index.vue
Adds a modal dialog with form inputs (title with error handling, description textarea) and Submit button. Introduces submitPost workflow that validates title, calls createPost API, and navigates to the created post. Adds state management for dialog visibility, form inputs, loading state, and permission-based UI disabling. New props: boardId (required, UUID-validated) and dashboard (optional). Imports new UI components (Dialog, LText, LTextarea, Button) and utilities (validateUUID, tokenError). Adds router navigation for post redirection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Form validation and error handling: Verify title validation logic, error clearing on input, and title-specific error display
  • submitPost workflow: Review validation flow, API call with boardId context, token error handling, and proper router navigation using post slug
  • State management: Ensure reactive properties (dialog visibility, input values, loading) are correctly synchronized and reset after submission
  • Permission checks: Confirm that button disabling logic accurately reflects user permissions to create posts

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/create post from home page' directly describes the main feature being added - enabling post creation from the homepage, which aligns with the primary change in the changeset.
Linked Issues check ✅ Passed The implementation fully addresses issue #1510 by adding a 'Submit Feedback' button that toggles a dialog for creating posts, with title input, description textarea, validation, and submission workflow.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the create post feature from the homepage as specified in issue #1510; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76c98b4 and 3e5ba1c.

📒 Files selected for processing (1)
  • packages/theme/src/pages/Index.vue (5 hunks)
⏰ 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). (7)
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v17
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v16
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v12.18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v14
  • GitHub Check: test
  • GitHub Check: lighthouse

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.

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

Lighthouse report

Category Score Status
Performance 98 🟢
Accessibility 94 🟢
Best Practices 100 🟢
SEO 100 🟢
PWA N/A

View workflow run

@TaranaKhanna
Copy link
Contributor Author

@mittalyashu, Ready for review

Copy link

@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: 4

🧹 Nitpick comments (2)
packages/theme/src/pages/Index.vue (2)

2-35: Add a title and close button to improve dialog UX.

The dialog is missing:

  1. A title/header (e.g., "Create New Post" or "Submit Feedback")
  2. An explicit close/cancel button

Add a title to the dialog:

 <Dialog v-model:open="showDialog">
+  <template #title>
+    Submit Feedback
+  </template>
   <l-text

If your Dialog component supports a close button, consider adding:

   <template #footer>
+    <Button
+      type="secondary"
+      @click="showDialog = false"
+    >
+      Cancel
+    </Button>
     <Button

37-45: Consider hiding the button when the user lacks create permissions.

The "Submit Feedback" button is always visible, but if the user lacks post:create permission, clicking it opens a dialog with disabled inputs. This creates a confusing experience.

Consider conditionally rendering the button:

- <div class="flex justify-center mb-8">
+ <div v-if="!createPostPermissionDisabled" class="flex justify-center mb-8">
    <Button

Alternatively, show a helpful message when permissions are missing:

  <div class="flex justify-center mb-8">
    <Button
        type="primary"
        data-test="open-post-dialog-button"
+       :disabled="createPostPermissionDisabled"
+       :title="createPostPermissionDisabled ? 'You need permission to create posts' : ''"
        @click="showDialog = true"
      >
        Submit Feedback
    </Button>
  </div>
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23fb34c and b530d1b.

📒 Files selected for processing (2)
  • docker/local/docker-compose.dev.yml (1 hunks)
  • packages/theme/src/pages/Index.vue (5 hunks)
⏰ 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). (7)
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v17
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v16
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v12.18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v14
  • GitHub Check: test
  • GitHub Check: lighthouse
🔇 Additional comments (3)
packages/theme/src/pages/Index.vue (3)

12-12: LGTM: Good keyboard UX!

Adding @keyup-enter to submit the form from the title field improves keyboard navigation and user experience.


66-94: LGTM: Imports are well-organized.

All new imports are used appropriately for the Create Post feature. Good organization separating modules, components, and utilities.


154-158: Clarify the boardId prop usage in post filtering.

The component requires a boardId prop (lines 99-102), but the getPosts call at line 157 uses an empty boardId: [] array, which ignores the prop.

Either:

  1. Pass the prop to getPosts: boardId: [props.boardId]
  2. Make boardId optional if the homepage should show all posts regardless of board

Copy link

@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)
packages/theme/src/App.vue (1)

151-163: Consider more robust extension detection for edge cases.

The current extension check using .endsWith() may not handle URLs with query parameters or fragments correctly (e.g., /icon.svg?v=123). For a more robust implementation, consider extracting the pathname before checking the extension.

🔎 Proposed enhancement
 link: [
   {
     rel: "icon",
     type: () => {
       const icon = settingsStore.get.icon || "/logchimp.svg";
-      if (icon.endsWith(".svg")) return "image/svg+xml";
-      if (icon.endsWith(".png")) return "image/png";
-      if (icon.endsWith(".ico")) return "image/x-icon";
+      const pathname = icon.split('?')[0].split('#')[0];
+      if (pathname.endsWith(".svg")) return "image/svg+xml";
+      if (pathname.endsWith(".png")) return "image/png";
+      if (pathname.endsWith(".ico")) return "image/x-icon";
       return "image/svg+xml";
     },
     href: () => settingsStore.get.icon || "/logchimp.svg",
   },
 ],
packages/theme/src/pages/Index.vue (1)

189-194: Consider adding title length validation.

While the empty title check is present, there's no validation for maximum title length. Long titles might cause UI issues or exceed database constraints.

🔎 Optional enhancement
 async function submitPost() {
   if (!title.value) {
     title.error.show = true;
     title.error.message = "You forgot to enter a post title";
     return;
   }
+  
+  if (title.value.length > 200) {
+    title.error.show = true;
+    title.error.message = "Title must be 200 characters or less";
+    return;
+  }

   loading.value = true;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b530d1b and 76c98b4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • packages/server/package.json (1 hunks)
  • packages/theme/index.html (0 hunks)
  • packages/theme/src/App.vue (1 hunks)
  • packages/theme/src/pages/Index.vue (5 hunks)
  • renovate.json (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/theme/index.html
⏰ 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). (7)
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v17
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v14
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v12.18
  • GitHub Check: API / Integration Tests - OS ubuntu-24.04 - Node v22 - Postgres v16
  • GitHub Check: test
  • GitHub Check: lighthouse
🔇 Additional comments (3)
renovate.json (1)

1-21: LGTM! Well-structured Renovate configuration.

The scheduling rules are clear and appropriately balance update frequency with review capacity. The timezone specification ensures predictable scheduling.

packages/theme/src/pages/Index.vue (1)

2-35: Dialog structure and permission checks are well-implemented.

The dialog correctly wires up input validation, error handling, enter-key submission, and permission-based disabling. Once the reactivity issue with permissions is resolved, this will function as intended.

packages/server/package.json (1)

31-31: nodemailer 7.0.11 is valid and free from known vulnerabilities.

Version 7.0.11 is the latest version of nodemailer, and Snyk confirms it as the latest non-vulnerable version. The DoS vulnerability (CVE-2025-14874) affecting address parsing in earlier versions has been fixed in v7.0.11. The package maintains healthy maintenance status with continued updates.

@TaranaKhanna TaranaKhanna force-pushed the create-post-from-homepage branch from 76c98b4 to 3e5ba1c Compare December 21, 2025 03:33
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.

Create post directly from homepage

1 participant