From 8f1142eb298be7a24070775533e79a4f32f776ff Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 11 Jul 2026 17:07:33 +0000 Subject: [PATCH 1/2] Add short note field to bookmark edit drawer - Allow note updates via BookmarkItemUpdateSchema and updateBookmarkItem - Add compact textarea in BookmarkEditDrawer (max 500 chars) - Show StickyNote indicator on list items that have a note Co-authored-by: Tsuten --- app/client/main.css | 9 +++++++-- app/imports/api/bookmarkItems.js | 7 ++++--- app/imports/ui/BookmarkEditDrawer.jsx | 14 ++++++++++++++ app/imports/ui/BookmarkItem.jsx | 17 ++++++++++++++--- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/app/client/main.css b/app/client/main.css index 78eb75f..77ce178 100644 --- a/app/client/main.css +++ b/app/client/main.css @@ -82,12 +82,17 @@ input:focus { @layer base { /* atoms */ - input { + input, + textarea { @apply bg-gray-100 p-1 text-sm min-w-0 max-w-full rounded-sm; } - input:focus { + input:focus, + textarea:focus { @apply outline-1 outline-gray-500; } + textarea { + @apply resize-y min-h-12; + } hr { @apply border-gray-300; } diff --git a/app/imports/api/bookmarkItems.js b/app/imports/api/bookmarkItems.js index da4991b..09c5442 100644 --- a/app/imports/api/bookmarkItems.js +++ b/app/imports/api/bookmarkItems.js @@ -48,7 +48,7 @@ export const BookmarkItemSchema = new SimpleSchema({ }, tags: { type: Array, optional: true }, 'tags.$': String, - note: { type: String, optional: true, trim: true }, + note: { type: String, optional: true, trim: true, max: 500 }, is_archived: { type: Boolean, optional: true, defaultValue: false }, userId: { type: String }, }); @@ -62,6 +62,7 @@ export const BookmarkItemUpdateSchema = new SimpleSchema({ }, tags: { type: Array, optional: true }, 'tags.$': String, + note: { type: String, optional: true, trim: true, max: 500 }, }); export async function insertBookmarkItem(doc = {}, userId) { @@ -117,10 +118,10 @@ Meteor.methods({ } }, - async updateBookmarkItem({ _id, title, url, tags } = {}) { + async updateBookmarkItem({ _id, title, url, tags, note } = {}) { if (!this.userId) { throw new Meteor.Error('not-authorized'); } - return updateBookmarkItem({ _id, title, url, tags }, this.userId); + return updateBookmarkItem({ _id, title, url, tags, note }, this.userId); }, }); diff --git a/app/imports/ui/BookmarkEditDrawer.jsx b/app/imports/ui/BookmarkEditDrawer.jsx index 0bfd76c..a577575 100644 --- a/app/imports/ui/BookmarkEditDrawer.jsx +++ b/app/imports/ui/BookmarkEditDrawer.jsx @@ -11,6 +11,7 @@ export const BookmarkEditDrawer = ({ bookmarkItem, onClose }) => { const [title, setTitle] = useState(''); const [url, setUrl] = useState(''); const [tags, setTags] = useState([]); + const [note, setNote] = useState(''); const [urlError, setUrlError] = useState(''); const [submitError, setSubmitError] = useState(''); const [submitting, setSubmitting] = useState(false); @@ -20,6 +21,7 @@ export const BookmarkEditDrawer = ({ bookmarkItem, onClose }) => { setTitle(bookmarkItem.title || ''); setUrl(bookmarkItem.url || ''); setTags(bookmarkItem.tags || []); + setNote(bookmarkItem.note || ''); setUrlError(''); setSubmitError(''); setSubmitting(false); @@ -49,6 +51,7 @@ export const BookmarkEditDrawer = ({ bookmarkItem, onClose }) => { title, url: url.trim(), tags, + note: note.trim(), }, (error) => { setSubmitting(false); @@ -112,6 +115,17 @@ export const BookmarkEditDrawer = ({ bookmarkItem, onClose }) => { +