Skip to content

fix(bookmarks): resolve previous folder name on move-undo toast#6119

Merged
idoshamun merged 2 commits into
mainfrom
eng-1599-feedback-bug-report-bookmark-folder-shows-undefined-after
May 31, 2026
Merged

fix(bookmarks): resolve previous folder name on move-undo toast#6119
idoshamun merged 2 commits into
mainfrom
eng-1599-feedback-bug-report-bookmark-folder-shows-undefined-after

Conversation

@idoshamun
Copy link
Copy Markdown
Member

@idoshamun idoshamun commented May 31, 2026

Summary

The Undo action on the Move Bookmark toast was passing only { id: listId } to the move handler, so the follow-up toast rendered Moved to undefined. This PR resolves the previous folder's name at undo time:

  • If the post originated in a folder, look the name up in the cached bookmark folder list.
  • If the post originated in Quick saves (no listId), fall back to the Quick saves label.
  • If the folder cannot be resolved (e.g. deleted between move and undo), the toast degrades to a generic Bookmark moved rather than showing the literal undefined.

Key decisions

  • Resolve the name at click time, not at toast creation, so a folder rename between move and undo is reflected correctly.
  • Adjacent strict-type cleanup surfaced by touching this file: widened MoveBookmarkToFolderProps.listId to optional to match the GraphQL schema ($listId: ID), aligned useMoveBookmarkToFolder's param type with that interface, broadened onMoveBookmark to accept targetId?: string, and added a null guard on the createFolder result. All callers were checked — backwards-compatible.
  • Extracted QUICK_SAVES_LABEL to de-duplicate the literal across the toast resolver and the Quick saves button.

Test plan

  • New MoveBookmarkModal.spec.tsx (4 cases): folder→Quick saves move, Quick saves→folder→undo, folder A→folder B→undo, deleted-folder fallback.
  • node ./scripts/typecheck-strict-changed.js
  • pnpm --filter shared lint on impacted files
  • pnpm --filter shared test — 4/4 pass

Closes ENG-1599


Created by Huginn 🐦‍⬛

Preview domain

https://eng-1599-feedback-bug-report-boo.preview.app.daily.dev

idoshamun and others added 2 commits May 31, 2026 12:16
The undo action in the Move Bookmark modal re-issued a move back to the
previous folder but only passed `{ id: listId }` to the handler, so the
toast rendered "Moved to undefined". Look up the previous folder name
from the bookmark folder list at undo time (falling back to "Quick
saves" when there is no `listId`), and use a generic copy if the folder
has since been deleted. Also widens `MoveBookmarkToFolderProps.listId`
to optional to match the GraphQL schema and clears the related strict
type errors surfaced by touching this file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rkModal

De-duplicates the "Quick saves" literal across the toast undo lookup and
the Quick saves button, and inlines the previous-folder-name resolver
into the undo call to drop the intermediate variable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview May 31, 2026 12:30pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored May 31, 2026 12:30pm

Request Review

@idoshamun idoshamun merged commit 853fcee into main May 31, 2026
12 checks passed
@idoshamun idoshamun deleted the eng-1599-feedback-bug-report-bookmark-folder-shows-undefined-after branch May 31, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant