Repository navigation
Empty folders, same-name folders and opt-in broken links (0.3.0) - #15
Conversation
Pure functions, tested with node: - findEmptyFolders: outermost folders without bookmarks, with a snapshot of their subfolders to recreate them - findSameNameFolders: sibling folders with the same name (ignoring case and spaces), oldest first - checkLink/checkAll/classifyLink: HEAD (GET if HEAD fails) with timeout, limited concurrency, 404/410 vs unreachable vs server error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgB2BE6SAL3zHCu6oLk3Tw
- the page has four tabs; the shell (main.js) handles tabs, action bar, confirmation, toast and Undo, each tab-*.js implements one tool - empty folders: delete with Undo (folders and subfolders recreated) - same-name folders: move the content into the oldest folder and remove the others, with Undo (folders recreated, items moved back in place) - broken links: optional host permission requested only when the user clicks Check links, revocable from the tab; results grouped by kind, only 404/410 preselected - fix: [hidden] wins over the display of components - version 0.3.0, description mentions the new tools Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgB2BE6SAL3zHCu6oLk3Tw
- describe the new tools; privacy text and badge no longer say "no network access", since the opt-in link check contacts the sites - new screenshots with the tabs, broken links and empty folders - store listing: justification for the optional host permissions Closes #14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgB2BE6SAL3zHCu6oLk3Tw
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
Deletion races can lose bookmark data, and nested merge Undo does not reliably restore the original hierarchy.
5 open issues
What changed in this PR
Expands Bookmark Cleaner beyond duplicate removal with folder cleanup and opt-in broken-link checking for version 0.3.0.
Changes:
- Adds empty-folder removal, same-name folder merging, and permission-gated link checking.
- Splits the interface into four tabs with shared confirmation and Undo controls.
- Updates tests, packaging, documentation, and store information.
| File | Description |
|---|---|
| tests/links.test.js | Tests link checks, classification, and cancellation. |
| tests/folders.test.js | Tests empty and same-name folder detection. |
| tab-links.js | Implements link checking and deletion controls. |
| tab-folders.js | Implements folder cleanup and Undo. |
| tab-duplicates.js | Extracts the duplicates interface. |
| style.css | Adds tab styles and fixes hidden elements. |
| store/package.sh | Packages the new modules. |
| store/listing.md | Updates features, permissions, and release notes. |
| README.md | Documents new cleanup tools. |
| manifest.json | Updates version and optional host permissions. |
| main.js | Centralizes tabs, actions, and Undo. |
| main.html | Loads modules and adds tab navigation. |
| links.js | Adds link-checking logic. |
| folders.js | Adds folder-detection logic. |
| docs/index.html | Updates landing-page features and FAQs. |
Review effort: Balanced
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f6612ea0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- empty folders are removed bottom-up with chrome.bookmarks.remove, which refuses non-empty folders: a bookmark added meanwhile (e.g. by sync) is never deleted - folder deletions and merges are recorded in a change log with the live position of each node; undo replays it backwards, so nested merges are restored exactly - broken links: re-read the tree before deleting and keep bookmarks whose URL changed after the check; undo uses their current data - a GET retry without answer is inconclusive (not OK, not 404) - merge checkbox ids use the oldest folder id, unique Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EgB2BE6SAL3zHCu6oLk3Tw


Closes #14.
The page now has four tabs: Duplicates, Empty folders, Same-name folders, Broken links. Every change asks for confirmation and can be undone from the toast.
Empty folders: outermost folders without bookmarks (nested empty subfolders are removed with them). Undo recreates the folders and their subfolders in place. Folders are re-checked right before deleting, so a folder that got a bookmark meanwhile is kept.
Same-name folders: sibling folders with the same name (case and surrounding spaces ignored) are merged into the oldest one: their items are moved into it, then the emptied folders are removed. Undo recreates the folders and moves the items back to their original positions.
Broken links (opt-in)
optional_host_permissions(http://*/*,https://*/*) requested withchrome.permissions.requestonly when the user clicks Check links; Revoke site access removes it. Nothing contacts any site before that.HEADrequest (GETifHEADfails with an HTTP error), no cookies, 15 s timeout, 6 at a time, with progress and Stop.Code
folders.jsandlinks.js, 10 new node tests (18 total).main.jsis now the shell (tabs with arrow-key navigation and#hash, action bar, dialog, toast, Undo);tab-duplicates.js,tab-folders.js,tab-links.jsimplement the tools.[hidden]now wins over components'display(the smart-matching switch stayed visible on other tabs).Docs and store
store/listing.md: justification for the optional host permission, release notes.Testing
node --test: 18/18..invaliddomain;chrome.permissions.requestwas stubbed; the local server sends CORS headers to stand in for the host permission.Generated by Claude Code