feat(intelligent-assistant): add inline rename for notebook resources - #3834
Conversation
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3834 +/- ##
==========================================
+ Coverage 58.33% 58.37% +0.03%
==========================================
Files 2432 2433 +1
Lines 96775 96917 +142
Branches 26912 26953 +41
==========================================
+ Hits 56455 56573 +118
- Misses 40121 40145 +24
Partials 199 199
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 10:19 AM UTC · Completed 10:26 AM UTC |
ReviewFindingsHigh
Medium
Low
Previous runReview — approvePR: #3834 — feat(intelligent-assistant): add inline rename for notebook resources SummaryThis PR adds inline rename functionality for notebook document resources. The implementation is well-structured, spanning backend (PATCH endpoint with conflict detection and rollback) and frontend (inline TextInput with extension separation, conflict validation, keyboard handling). Test coverage is thorough across all layers. What looks good
Findings1. Non-atomic rename relies on delete-then-create with a brief inconsistency window
2. No maximum length or character validation on new title
The PATCH endpoint validates that 3. Rename tooltip and kebab item shown unconditionally
The "Double-click to rename" tooltip and the "Rename" kebab dropdown item are always rendered, regardless of whether VerdictThe implementation is solid, well-tested, and follows established patterns in the codebase. The non-atomic rename is an inherent API limitation handled with appropriate rollback protection. The PR is safe to merge. Labels: PR adds a PATCH endpoint and inline rename UI within the intelligent-assistant workspace |
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
@JslYoon Please review the backend changes. |
HusneShabbir
left a comment
There was a problem hiding this comment.
I noticed a slight delay in the file renaming process. It seems the non-atomic rename relies on a delete-then-create flow, which introduces a brief inconsistency window. I'd encourage @JslYoon to take a closer look and suggest any improvements if applicable.
Also, could you please address comments 1 and 2 from the Fullsend review? Specifically:
- 1: The non-atomic rename (
delete→create) introduces a brief inconsistency window. - 2: Very long title names don't add much value; it would be better to consider adding a length cap.
Screen.Recording.2026-07-20.at.1.24.16.PM.mov
| * @throws NotFoundError if document not found | ||
| * @throws ConflictError if newTitle conflicts with existing document | ||
| */ | ||
| async renameDocument( |
There was a problem hiding this comment.
There already exists a function upsertDocument that handles document updates, which follows the same logic as this function, please use it instead.
There was a problem hiding this comment.
@JslYoon Done — removed renameDocument and consolidated into upsertDocument with an options object ({ fileType?, fileId?, newTitle? }). Added rollback protection, attribute preservation, defensive fileType fallback, and a 255-char title length cap at the router level.
One concern: rename latency on local itself is 1–2 min due to the delete → re-create flow on the vector store (no in-place attribute update API). Can we do something here ?
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Addressed both points:
|
|
@ShiranHi Handled all your below feedbacks and have updated the screen recording please have a look.
|
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
/fs-review |
|
🤖 Finished Review · ❌ Failure · Started 3:29 AM UTC · Completed 4:09 AM UTC |
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 4:19 AM UTC · Completed 4:37 AM UTC |
LGTM, thank you! |
Yes unfortunately this is a problem with the nature of how vector stores are configured in the upstream, and would require bigger code changes upstream for delete/insert to be faster. However, I'm addressing this issue right now through https://redhat.atlassian.net/browse/RHDHBUGS-3302 |
JslYoon
left a comment
There was a problem hiding this comment.
Backend changes look good
…nt-inline-document-rename Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> # Conflicts: # workspaces/intelligent-assistant/plugins/intelligent-assistant-backend/src/service/notebooks/documents/documentService.ts # workspaces/intelligent-assistant/plugins/intelligent-assistant/src/components/__tests__/DocumentSidebar.test.tsx # workspaces/intelligent-assistant/plugins/intelligent-assistant/src/components/notebooks/DocumentSidebar.tsx # workspaces/intelligent-assistant/plugins/intelligent-assistant/src/components/notebooks/NotebookView.tsx
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
@ShiranHi @HusneShabbir @tobiastal
Happy flow S_.2026-08-07.at.3.05.19.PM.movAPI failure S_.2026-08-07.at.3.19.08.PM.mov |
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
The document rename file was jumping to the top of the list. I made changes to preserve positions of documents in the sidebar @JslYoon : Added UI before changesS_.2026-08-07.at.5.18.34.PM.movUI after changesS_.2026-08-07.at.5.17.34.PM.mov |
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
ciiay
left a comment
There was a problem hiding this comment.
Thanks for the work on this — the rename flow looks solid overall (optimistic update, validation, rollback, and the created_at ordering fix are appreciated).
Please address #1 and #3 before merge. #2 is a nit only.
Requested changes
- Document the new PATCH endpoint in the backend README Documents API list (implementation is already in place; docs are missing).
- Keep the inline editor open when the name is invalid (too long / conflict) on Enter or blur, instead of calling
cancelEditing().
Nit
- Add a trailing period to the EN
notebook.document.rename.tooLongstring for consistency with the conflict message and other locales.
| documents.some(d => d.document_id !== docId && d.title === newFullName) | ||
| ) { | ||
| cancelEditing(); | ||
| return; |
There was a problem hiding this comment.
Requested change: When the name is too long or conflicts, saveRename currently calls cancelEditing() and exits edit mode (on both Enter and blur).
Please keep the user in the inline editor when validation fails so the error helper text remains visible and they can correct the name. For example, early-return without cancelEditing() when getValidationError(docId, originalTitle) is non-null (empty / unchanged can still cancel as today).
There was a problem hiding this comment.
We intentionally cancel on blur/Enter when validation fails. The error is visible in real-time while the user types, giving them a chance to correct it before submitting. If they press Enter or click away with an invalid name, we treat it as an implicit cancel (same as Escape) and revert to the original name. This avoids trapping the user in the editor and matches common file-rename UX patterns (e.g. macOS Finder).
Cc: @ShiranHi @tobiastal
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
…ithub.com:its-mitesh-kumar/rhdh-plugins into feat/intelligent-assistant-inline-document-rename
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|



Description
Adds inline rename capability for notebook documents (resources) in the DocumentSidebar with full backend support.
Fixed
Backend
renameDocumentlogic intoupsertDocumentusing an options object ({ fileType?, fileId?, newTitle? }) to eliminate code duplicationupsertDocumentincludes rollback protection: if the vector store re-creation fails after delete, the original entry is restoredresolvedFileTypeto preventundefinedvalues in attributesFrontend
UI after fix
S_.2026-07-26.at.7.09.52.AM.mov
Translations
notebook.document.rename.tooLongkey across all 6 languagesnotebook.document.rename.successkeyFixed
✔️ Checklist