From 8f722c5751b26447d93f43d3d08fcd22e330ad68 Mon Sep 17 00:00:00 2001 From: Nicola Date: Mon, 6 Apr 2026 22:18:38 +0200 Subject: [PATCH] fix: allow to remove project description (#2338) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes https://github.com/paperclipai/paperclip/issues/2336 ## Thinking Path - Paperclip allows to manage projects - During the project creation you can optionally enter a description - In the project overview or configuration you can edit the description - However, you cannot remove the description - The user should be able to remove the project description because it's an optional property - This pull request fixes the frontend bug that prevented the user to remove/clear the project description ## What Changed - project description can be cleared in "project configuration" and "project overview" ## Verification In project configuration or project overview: - In the description field remove/clear the text ## Risks - none ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge --- ui/src/components/InlineEditor.test.tsx | 170 ++++++++++++++++++++++-- ui/src/components/InlineEditor.tsx | 53 +++++--- ui/src/components/ProjectProperties.tsx | 1 + ui/src/pages/ProjectDetail.tsx | 1 + 4 files changed, 191 insertions(+), 34 deletions(-) diff --git a/ui/src/components/InlineEditor.test.tsx b/ui/src/components/InlineEditor.test.tsx index ddf99936..1f474f7b 100644 --- a/ui/src/components/InlineEditor.test.tsx +++ b/ui/src/components/InlineEditor.test.tsx @@ -1,27 +1,171 @@ // @vitest-environment jsdom -import { act } from "react"; +import { act, forwardRef, useImperativeHandle, useRef } from "react"; +import { createRoot } from "react-dom/client"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import { queueContainedBlurCommit } from "./InlineEditor"; vi.mock("./MarkdownEditor", () => ({ - MarkdownEditor: () => null, -})); - -vi.mock("../hooks/useAutosaveIndicator", () => ({ - useAutosaveIndicator: () => ({ - state: "idle", - markDirty: () => {}, - reset: () => {}, - runSave: async (save: () => Promise) => { - await save(); - }, + MarkdownEditor: forwardRef< + { focus: () => void }, + { value: string; onChange: (value: string) => void } + >(function MarkdownEditorMock(props, ref) { + const taRef = useRef(null); + useImperativeHandle(ref, () => ({ + focus: () => taRef.current?.focus(), + })); + return ( +