-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: edit messages #650
feat: edit messages #650
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Caution Review failedThe pull request is closed. WalkthroughThe changes involve enhancements to message handling in a chat application. A new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatPage
participant MessageComponent
participant API
User->>ChatPage: Clicks edit on message
ChatPage->>MessageComponent: Set editingMessageId
MessageComponent->>ChatPage: Show edit button
User->>MessageComponent: Edits message content
MessageComponent->>API: editMessage mutation
API->>ChatPage: Update message optimistically
ChatPage->>User: Display updated message
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Hey @FleetAdmiralJakob, here is an example of how you can ask me to improve this pull request: @Sweep Add unit tests for the `editMessage` mutation in `convex/messages.ts` that cover: 📖 For more information on how to use Sweep, please read our documentation. |
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: 9
🧹 Outside diff range and nitpick comments (6)
convex/schema.ts (1)
41-41
: Consider enhancing edit tracking capabilities.While the current implementation is sufficient for basic edit tracking, consider these potential enhancements for better audit capabilities:
- Add
modifiedAt: v.optional(v.string())
to track when the message was last modified- Add
modifiedBy: v.optional(v.id("users"))
to track who modified the message- Add
editHistory
as a separate entity to maintain a complete history of changesWould you like me to provide a schema implementation for these enhancements?
🧰 Tools
🪛 eslint
[error] 38-41: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
convex/messages.ts (2)
183-209
: Add rate limiting and audit logging to message editing.While the basic editing functionality is implemented correctly, consider adding these security enhancements:
- Rate limiting to prevent abuse
- Audit logging for tracking message modifications
- Edit window limitation (e.g., 24 hours)
🧰 Tools
🪛 eslint
[error] 183-209: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 183-183: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe member access .newContent on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 189-189: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 189-189: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 189-189: Unsafe member access .auth on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 196-196: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe member access .table on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .getX on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .messageId on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 198-198: Unsafe member access .edge on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .clerkId on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .tokenIdentifier on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 204-204: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 204-204: Unsafe member access .patch on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 205-205: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 205-205: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 205-205: Unsafe member access .newContent on an
any
value.(@typescript-eslint/no-unsafe-member-access)
186-187
: Enhance input validation.Consider adding more comprehensive content validation:
- Maximum length check
- Content sanitization
- Proper type safety
Example implementation:
const MAX_MESSAGE_LENGTH = 1000; if (args.newContent.trim() === "") { throw new MessageValidationError("Message cannot be empty"); } if (args.newContent.length > MAX_MESSAGE_LENGTH) { throw new MessageValidationError(`Message cannot exceed ${MAX_MESSAGE_LENGTH} characters`); }🧰 Tools
🪛 eslint
[error] 186-186: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe member access .newContent on an
any
value.(@typescript-eslint/no-unsafe-member-access)
src/components/message.tsx (2)
17-17
: Consider using a more specific type for the message IDWhile the current type works, consider creating a dedicated type alias for message IDs to improve code maintainability and type safety:
type MessageId = Id<"messages">; // Then use it in props: setEditingMessageId: React.Dispatch<React.SetStateAction<MessageId | null>>;Also applies to: 32-41
304-313
: Consider UX improvements for message editingThe edit button implementation is good, but consider these UX enhancements:
- Add a tooltip to indicate any time limits for editing
- Consider adding a confirmation dialog for edits, especially if there are restrictions
- Add visual feedback (like a loading state) during the edit operation
Example tooltip implementation:
<button className="flex w-full cursor-pointer border-y-2 border-secondary-foreground p-2 pr-8" + title="Edit message (available for 24 hours after sending)" onClick={() => { setEditingMessageId(message._id); setIsModalOpen(!isModalOpen); }} >
🧰 Tools
🪛 eslint
[error] 307-307: Unsafe argument of type error typed assigned to a parameter of type
SetStateAction<Id<"messages"> | null>
.(@typescript-eslint/no-unsafe-argument)
[error] 307-307: Unsafe member access ._id on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
src/app/(internal-sites)/chats/[chatId]/page.tsx (1)
Line range hint
505-583
: Improve accessibility and layout consistencyThe UI elements need better accessibility support and consistent spacing.
Consider these improvements:
-<div className="flex w-full justify-between gap-8"> +<div className="flex w-full items-center justify-between gap-4 lg:gap-8"> <Form {...textMessageForm}> <form className="w-full" ref={formRef} onSubmit={textMessageForm.handleSubmit(onTextMessageFormSubmit)} > {/* ... */} </form> </Form> - <div className="flex items-center gap-8"> + <div className="flex items-center gap-4 lg:gap-8"> <Mic className={cn( "h-11 w-11 cursor-pointer rounded-sm border-2 border-secondary-foreground bg-primary p-2 lg:h-14 lg:w-14 lg:p-3", { hidden: inputValue !== "" }, )} + aria-label="Voice message" /> <X className={cn( "h-11 w-11 cursor-pointer rounded-sm border-2 border-secondary-foreground bg-primary p-2 lg:h-14 lg:w-14 lg:p-3", { hidden: editingMessageId === null }, )} + aria-label="Cancel editing" onClick={() => { setEditingMessageId(null); textMessageForm.reset(); setInputValue(""); }} /> <SendHorizontal onClick={(e) => { setAnimationInput(!animationInput); void textMessageForm.handleSubmit(onTextMessageFormSubmit)(e); }} className={cn( "h-11 w-11 cursor-pointer rounded-sm border-2 border-secondary-foreground bg-primary p-2 lg:h-14 lg:w-14 lg:p-3", { hidden: inputValue === "" }, )} + aria-label="Send message" /> <Plus className={cn( "h-11 w-11 cursor-pointer rounded-sm border-2 border-secondary-foreground bg-primary p-2 lg:h-14 lg:w-14 lg:p-3", { hidden: inputValue !== "" }, )} + aria-label="Add attachment" onClick={menuClick} /> </div> </div>🧰 Tools
🪛 eslint
[error] 545-548: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 552-555: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 558-558: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 558-558: Unsafe member access .reset on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
convex/messages.ts
(3 hunks)convex/schema.ts
(1 hunks)src/app/(internal-sites)/chats/[chatId]/page.tsx
(14 hunks)src/components/message.tsx
(5 hunks)
🧰 Additional context used
🪛 eslint
convex/messages.ts
[error] 95-95: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 95-95: Unsafe member access .content on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe member access .insert on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 98-98: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 98-98: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 99-99: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 100-100: Unsafe member access .content on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 102-102: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 132-132: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 132-132: Unsafe member access .privateChatId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 133-133: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 133-133: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 133-133: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 133-133: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 133-133: Unsafe member access .getX on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 134-134: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 134-134: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 134-134: Unsafe member access .edge on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 183-209: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 183-183: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe member access .newContent on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 189-189: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 189-189: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 189-189: Unsafe member access .auth on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 196-196: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .getX on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .messageId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 198-198: Unsafe member access .edge on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .clerkId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .tokenIdentifier on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 204-204: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 204-204: Unsafe member access .patch on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 205-205: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 205-205: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 205-205: Unsafe member access .newContent on an any
value.
(@typescript-eslint/no-unsafe-member-access)
convex/schema.ts
[error] 38-41: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/app/(internal-sites)/chats/[chatId]/page.tsx
[error] 196-196: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 196-196: Unsafe member access .newContent on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-200: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 201-201: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 208-208: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 208-208: Unsafe member access .map on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 209-209: Unsafe member access .type on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 209-209: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 209-209: Unsafe member access .messageId on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 210-214: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 212-212: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 216-216: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 221-223: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 221-221: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 221-221: Unsafe member access .find on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 222-222: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 223-223: Unsafe member access .lastMessage on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 226-226: Unsafe member access ._id on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 226-226: Unsafe member access .messageId on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 227-227: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 232-232: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 232-232: Unsafe member access .map on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 233-233: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 234-241: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 236-240: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 238-238: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 243-243: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 274-274: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 274-274: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 292-294: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 292-292: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 292-292: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 293-293: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 295-295: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 296-296: Unsafe argument of type error typed assigned to a parameter of type SetStateAction<string>
.
(@typescript-eslint/no-unsafe-argument)
[error] 296-296: Unsafe member access .content on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 302-302: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 314-316: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 314-314: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 314-314: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 315-315: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 320-320: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 321-321: Unsafe member access .content on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 321-321: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 321-321: Unsafe member access .message on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 325-325: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 325-325: Unsafe member access .message on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 331-331: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 331-331: Unsafe member access .message on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 529-529: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 529-529: Unsafe member access .onChange on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 532-532: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 532-532: Unsafe member access .ref on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 545-548: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 552-555: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 558-558: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 558-558: Unsafe member access .reset on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/components/message.tsx
[error] 207-207: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 207-207: Unsafe member access .modified on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 307-307: Unsafe argument of type error typed assigned to a parameter of type SetStateAction<Id<"messages"> | null>
.
(@typescript-eslint/no-unsafe-argument)
[error] 307-307: Unsafe member access ._id on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 338-338: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 338-338: Unsafe member access .setReference on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 339-343: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 341-341: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 342-342: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 346-346: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 346-346: Unsafe member access .modified on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
🔇 Additional comments (2)
convex/schema.ts (1)
41-41
: LGTM! The schema change looks good.
The addition of the modified
boolean field with a default value of false
is appropriate for tracking message edit status.
🧰 Tools
🪛 eslint
[error] 38-41: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
convex/messages.ts (1)
103-103
: LGTM: Modified flag initialization.
The modified: false
flag is correctly initialized for new messages, supporting the new editing feature.
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: 6
🧹 Outside diff range and nitpick comments (5)
convex/schema.ts (1)
41-42
: Consider using a timestamp type for modifiedAt.The schema changes for supporting message editing look good. However, consider using
v.number()
formodifiedAt
to store Unix timestamps instead of strings. This would provide better consistency and enable easier date comparisons and sorting..field("modified", v.boolean(), { default: false }) - .field("modifiedAt", v.optional(v.string())) + .field("modifiedAt", v.optional(v.number()))🧰 Tools
🪛 eslint
[error] 38-42: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
[error] 42-42: Unsafe member access .field on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
convex/messages.ts (2)
95-103
: Consider initializing modifiedAt along with modified flag.For consistency with the edit functionality, consider initializing
modifiedAt
asnull
when creating a message. This ensures a uniform data structure across all messages.await ctx.table("messages").insert({ userId: convexUser._id, privateChatId: parsedChatId, content: args.content.trim(), deleted: false, readBy: [convexUser._id], modified: false, + modifiedAt: null, });
🧰 Tools
🪛 eslint
[error] 95-95: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 95-95: Unsafe member access .content on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe member access .table on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe member access .insert on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 98-98: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 98-98: Unsafe member access ._id on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 99-99: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 100-100: Unsafe member access .content on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 102-102: Unsafe member access ._id on an
any
value.(@typescript-eslint/no-unsafe-member-access)
183-210
: Consider adding rate limiting for message edits.To prevent abuse, consider implementing rate limiting for message edits. This could include:
- Maximum number of edits per message
- Time window after message creation during which edits are allowed
- Cooldown period between edits
Would you like me to provide an implementation for rate limiting?
🧰 Tools
🪛 eslint
[error] 183-210: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 183-183: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe member access .newContent on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 189-189: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 189-189: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 189-189: Unsafe member access .auth on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 196-196: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe member access .table on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .getX on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .messageId on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 198-198: Unsafe member access .edge on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .clerkId on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .tokenIdentifier on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 204-204: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 204-204: Unsafe member access .patch on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 205-205: Unsafe assignment of an
any
value.(@typescript-eslint/no-unsafe-assignment)
[error] 205-205: Unsafe call of a(n)
any
typed value.(@typescript-eslint/no-unsafe-call)
[error] 205-205: Unsafe member access .newContent on an
any
value.(@typescript-eslint/no-unsafe-member-access)
src/components/message.tsx (1)
304-317
: Enhance accessibility for edit message buttonWhile the edit functionality is well-implemented, let's improve accessibility:
<button className="flex w-full cursor-pointer border-y-2 border-secondary-foreground p-2 pr-8" + aria-label="Edit message" + role="menuitem" onClick={() => { setEditingMessageId(message._id); setIsModalOpen(!isModalOpen); }} > <Pen /> - <p className="ml-1">Edit</p> + <span className="ml-1">Edit</span> </button>🧰 Tools
🪛 eslint
[error] 311-311: Unsafe argument of type error typed assigned to a parameter of type
SetStateAction<Id<"messages"> | null>
.(@typescript-eslint/no-unsafe-argument)
[error] 311-311: Unsafe member access ._id on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
src/app/(internal-sites)/chats/[chatId]/page.tsx (1)
312-329
: LGTM! Consider extracting message editing logicThe form submission logic handles both new messages and edits well, with proper validation. Consider extracting the message editing logic into a separate function for better maintainability.
+const handleMessageEdit = (message: string, editId: Id<"messages">) => { + const existingMessage = messages.data?.find((m) => m._id === editId); + if (existingMessage?.type === "message" && existingMessage.content !== message) { + void editMessage({ + newContent: message, + messageId: editId, + }); + } + setEditingMessageId(null); +}; async function onTextMessageFormSubmit( values: z.infer<typeof textMessageSchema>, ) { const trimmedMessage = values.message.trim(); if (!trimmedMessage) return; if (editingMessageId) { - const message = messages.data?.find((message) => { - return message._id === editingMessageId; - }); - - if (message?.type === "message" && message.content !== trimmedMessage) { - void editMessage({ - newContent: trimmedMessage, - messageId: editingMessageId, - }); - } - setEditingMessageId(null); + handleMessageEdit(trimmedMessage, editingMessageId); } else { void sendMessage({ content: trimmedMessage, chatId: params.chatId }); }🧰 Tools
🪛 eslint
[error] 312-312: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 312-312: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 312-312: Unsafe member access .message on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
[error] 316-318: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 316-316: Unsafe call of a(n)
error
type typed value.(@typescript-eslint/no-unsafe-call)
[error] 316-316: Unsafe member access .data on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
[error] 317-317: Unsafe member access ._id on an
any
value.(@typescript-eslint/no-unsafe-member-access)
[error] 320-320: Unsafe member access .type on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
[error] 320-320: Unsafe member access .content on an
error
typed value.(@typescript-eslint/no-unsafe-member-access)
[error] 322-322: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 328-328: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
convex/messages.ts
(3 hunks)convex/schema.ts
(1 hunks)src/app/(internal-sites)/chats/[chatId]/page.tsx
(14 hunks)src/components/message.tsx
(5 hunks)
🧰 Additional context used
🪛 eslint
convex/messages.ts
[error] 95-95: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 95-95: Unsafe member access .content on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 97-97: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 97-97: Unsafe member access .insert on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 98-98: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 98-98: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 99-99: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 100-100: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 100-100: Unsafe member access .content on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 102-102: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 132-132: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 132-132: Unsafe member access .privateChatId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 133-133: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 133-133: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 133-133: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 133-133: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 133-133: Unsafe member access .getX on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 134-134: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 134-134: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 134-134: Unsafe member access .edge on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 183-210: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 183-183: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 186-186: Unsafe member access .newContent on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 189-189: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 189-189: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 189-189: Unsafe member access .auth on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 196-196: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 196-196: Unsafe member access .table on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .getX on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 196-196: Unsafe member access .messageId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 198-198: Unsafe member access .edge on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .clerkId on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 198-198: Unsafe member access .tokenIdentifier on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 204-204: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 204-204: Unsafe member access .patch on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 205-205: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 205-205: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 205-205: Unsafe member access .newContent on an any
value.
(@typescript-eslint/no-unsafe-member-access)
convex/schema.ts
[error] 38-42: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 42-42: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/app/(internal-sites)/chats/[chatId]/page.tsx
[error] 196-196: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 198-200: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 201-201: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 209-209: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 209-209: Unsafe member access .map on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 210-210: Unsafe member access .type on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 210-210: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 211-216: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 213-213: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 218-218: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 223-225: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 223-223: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 223-223: Unsafe member access .find on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 224-224: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 225-225: Unsafe member access .lastMessage on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 227-227: Unsafe member access ._id on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 227-227: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 231-231: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 231-231: Unsafe member access .map on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 232-232: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 233-241: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 235-240: Unsafe assignment of an any
value.
(@typescript-eslint/no-unsafe-assignment)
[error] 237-237: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 243-243: Unsafe return of a value of type any
.
(@typescript-eslint/no-unsafe-return)
[error] 273-273: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 273-273: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 291-293: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 291-291: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 291-291: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 292-292: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 294-294: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 295-295: Unsafe argument of type error typed assigned to a parameter of type SetStateAction<string>
.
(@typescript-eslint/no-unsafe-argument)
[error] 295-295: Unsafe member access .content on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 301-301: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 312-312: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 312-312: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 312-312: Unsafe member access .message on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 316-318: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 316-316: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 316-316: Unsafe member access .data on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 317-317: Unsafe member access ._id on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 320-320: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 320-320: Unsafe member access .content on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 322-322: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 328-328: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 527-527: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 527-527: Unsafe member access .onChange on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 530-530: Unsafe call of a(n) any
typed value.
(@typescript-eslint/no-unsafe-call)
[error] 530-530: Unsafe member access .ref on an any
value.
(@typescript-eslint/no-unsafe-member-access)
[error] 543-546: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 550-553: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 556-556: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 556-556: Unsafe member access .reset on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/components/message.tsx
[error] 34-34: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 34-34: Unsafe member access .modified on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 214-214: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 311-311: Unsafe argument of type error typed assigned to a parameter of type SetStateAction<Id<"messages"> | null>
.
(@typescript-eslint/no-unsafe-argument)
[error] 311-311: Unsafe member access ._id on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 342-342: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 342-342: Unsafe member access .setReference on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 343-347: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 345-345: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 346-346: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 349-349: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
🔇 Additional comments (5)
convex/schema.ts (1)
41-42
: Verify the mutation implementations.
Let's ensure the mutations are correctly handling these new fields.
✅ Verification successful
Mutation implementations are correctly handling the modified fields
The codebase shows proper implementation of the modified
and modifiedAt
fields:
- New messages are created with
modified: false
by default - When editing messages, both fields are properly set (
modified: true
andmodifiedAt: Date.now().toString()
)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check how these fields are used in mutations
# Expected: Find implementations setting modified=true and modifiedAt when editing
# Look for mutations handling message edits
ast-grep --pattern 'export async function editMessage($_) {
$$$
}'
# Look for any direct modifications of these fields
rg -l 'modified.*=.*true|modifiedAt.*=' convex/
Length of output: 120
Script:
#!/bin/bash
# Let's try a broader search for mutations and message-related functions
# Look for any functions that might be editing messages
rg -A 10 "export.*function.*[Mm]essage" convex/
# Also search for any usage of these fields in the codebase
rg -A 3 "modified[\"']?:|modifiedAt[\"']?:" convex/
Length of output: 401
Script:
#!/bin/bash
# Let's see the full context of the message mutations to verify proper implementation
rg -B 5 -A 15 "modified: (true|false)" convex/messages.ts
Length of output: 795
🧰 Tools
🪛 eslint
[error] 38-42: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 41-41: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 42-42: Unsafe member access .field on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/components/message.tsx (3)
37-49
: LGTM: Props structure and types are well-defined
The new setEditingMessageId
prop is properly typed and well-integrated with existing props.
214-214
: LGTM: ModifiedLabel integration is clean and consistent
The ModifiedLabel component is properly integrated in both sender and receiver message views, maintaining consistency and following the DRY principle.
Also applies to: 349-349
🧰 Tools
🪛 eslint
[error] 214-214: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
34-34
: Verify message type handling across the codebase
Let's ensure consistent message type handling across the codebase:
Also applies to: 311-311, 345-346
✅ Verification successful
Based on the shell script results, I can now generate the final response:
Message type handling is consistent across the codebase
The verification shows that message type checks and property access patterns are consistently implemented:
- All message type checks use the correct string literals: "message", "pendingRequest", "rejectedRequest", "expiredRequest"
- Type-specific properties (modified, deleted, content, etc.) are only accessed after appropriate type checks
- The conditional rendering at line 34 follows the same pattern as other type-guarded accesses
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check message type handling patterns across the codebase
# Search for message type checks
echo "Checking message type handling patterns:"
rg -A 2 'message\.type\s*===?\s*"(message|pendingRequest|rejectedRequest|expiredRequest)"'
# Search for message property access patterns
echo -e "\nChecking message property access patterns:"
ast-grep --pattern 'message.$_'
Length of output: 13857
🧰 Tools
🪛 eslint
[error] 34-34: Unsafe member access .type on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
[error] 34-34: Unsafe member access .modified on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
src/app/(internal-sites)/chats/[chatId]/page.tsx (1)
Line range hint 503-582
: LGTM! Clean UI implementation
The UI changes for message editing are well-implemented:
- Good use of conditional rendering for edit/cancel buttons
- Proper styling consistency with existing UI elements
- Clear visual feedback for editing state
🧰 Tools
🪛 eslint
[error] 543-546: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 550-553: Unsafe assignment of an error typed value.
(@typescript-eslint/no-unsafe-assignment)
[error] 556-556: Unsafe call of a(n) error
type typed value.
(@typescript-eslint/no-unsafe-call)
[error] 556-556: Unsafe member access .reset on an error
typed value.
(@typescript-eslint/no-unsafe-member-access)
closes #328
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
UI Enhancements