-
-
Notifications
You must be signed in to change notification settings - Fork 198
Feat/create post from home page #1530
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
base: master
Are you sure you want to change the base?
Feat/create post from home page #1530
Conversation
|
Note
|
| 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
📒 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Lighthouse report
|
|
@mittalyashu, Ready for review |
There was a problem hiding this 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:
- A title/header (e.g., "Create New Post" or "Submit Feedback")
- An explicit close/cancel button
Add a title to the dialog:
<Dialog v-model:open="showDialog"> + <template #title> + Submit Feedback + </template> <l-textIf 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:createpermission, 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"> <ButtonAlternatively, 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
📒 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-enterto 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 theboardIdprop usage in post filtering.The component requires a
boardIdprop (lines 99-102), but thegetPostscall at line 157 uses an emptyboardId: []array, which ignores the prop.Either:
- Pass the prop to
getPosts:boardId: [props.boardId]- Make
boardIdoptional if the homepage should show all posts regardless of board
There was a problem hiding this 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
permissionsis 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.
76c98b4 to
3e5ba1c
Compare
fixes: #1510
2025-12-06.11-53-23.mp4
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.