fix: word-wrap overflow in source cards, note editor, and inline edit
Add break-all to SourceCard title and InlineEdit display text so long unbroken strings wrap instead of overflowing the container. Add min-w-0 to NoteEditorDialog form to prevent grid item expansion. Also fix RecordID type error in notes API by converting command_id to string before passing to NoteResponse (fixes 500 on note create/update).
This commit is contained in:
parent
3b18e5c8ec
commit
c596ed2233
4 changed files with 5 additions and 5 deletions
|
|
@ -96,7 +96,7 @@ async def create_note(note_data: NoteCreate):
|
||||||
note_type=new_note.note_type,
|
note_type=new_note.note_type,
|
||||||
created=str(new_note.created),
|
created=str(new_note.created),
|
||||||
updated=str(new_note.updated),
|
updated=str(new_note.updated),
|
||||||
command_id=command_id,
|
command_id=str(command_id) if command_id else None,
|
||||||
)
|
)
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
raise
|
raise
|
||||||
|
|
@ -160,7 +160,7 @@ async def update_note(note_id: str, note_update: NoteUpdate):
|
||||||
note_type=note.note_type,
|
note_type=note.note_type,
|
||||||
created=str(note.created),
|
created=str(note.created),
|
||||||
updated=str(note.updated),
|
updated=str(note.updated),
|
||||||
command_id=command_id,
|
command_id=str(command_id) if command_id else None,
|
||||||
)
|
)
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
raise
|
raise
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ export function NoteEditorDialog({ open, onOpenChange, notebookId, note }: NoteE
|
||||||
<DialogTitle className="sr-only">
|
<DialogTitle className="sr-only">
|
||||||
{isEditing ? t.sources.editNote : t.sources.createNote}
|
{isEditing ? t.sources.editNote : t.sources.createNote}
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<form onSubmit={handleSubmit(onSubmit)} className="flex h-full flex-col">
|
<form onSubmit={handleSubmit(onSubmit)} className="flex h-full flex-col min-w-0">
|
||||||
{isEditing && noteLoading ? (
|
{isEditing && noteLoading ? (
|
||||||
<div className="flex-1 flex items-center justify-center py-10">
|
<div className="flex-1 flex items-center justify-center py-10">
|
||||||
<span className="text-sm text-muted-foreground">{t.common.loading}</span>
|
<span className="text-sm text-muted-foreground">{t.common.loading}</span>
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ export function InlineEdit({
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={cn(
|
className={cn(
|
||||||
"cursor-pointer hover:bg-muted/50 rounded px-2 py-1 -mx-2 -my-1 transition-colors text-left w-full",
|
"cursor-pointer hover:bg-muted/50 rounded px-2 py-1 -mx-2 -my-1 transition-colors text-left w-full break-all",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ export function SourceCard({
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<div className={cn('mb-1.5', !isCompleted && 'mb-1')}>
|
<div className={cn('mb-1.5', !isCompleted && 'mb-1')}>
|
||||||
<h4
|
<h4
|
||||||
className="text-sm font-medium leading-tight line-clamp-2"
|
className="text-sm font-medium leading-tight line-clamp-2 break-all"
|
||||||
title={title}
|
title={title}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue