Skip to content

Empty folders, same-name folders and opt-in broken links (0.3.0) - #15

Merged
wiso merged 4 commits into
masterfrom
claude/blissful-babbage-07hph3
Oct 19, 2026
Merged

wiso merged 4 commits into
masterfrom
claude/blissful-babbage-07hph3

Conversation

@wiso

@wiso wiso commented Oct 19, 2026

Copy link
Copy Markdown
Owner

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 with chrome.permissions.request only when the user clicks Check links; Revoke site access removes it. Nothing contacts any site before that.
  • Each unique URL gets a HEAD request (GET if HEAD fails with an HTTP error), no cookies, 15 s timeout, 6 at a time, with progress and Stop.
  • Results grouped as Page not found (404/410, preselected), Site unreachable, Server error or no answer (not preselected, may be temporary). 401/403/429 count as OK. If every site is unreachable, a toast suggests checking the connection.

Code

  • Pure logic in folders.js and links.js, 10 new node tests (18 total).
  • main.js is now the shell (tabs with arrow-key navigation and #hash, action bar, dialog, toast, Undo); tab-duplicates.js, tab-folders.js, tab-links.js implement the tools.
  • Fix: [hidden] now wins over components' display (the smart-matching switch stayed visible on other tabs).
  • Version 0.3.0; manifest description mentions the new tools.

Docs and store

  • README, landing page (features, FAQ, structured data) and store listing updated. The privacy text no longer says "no network access", since the opt-in check contacts the sites; the README badge is now "tracking: none".
  • New store screenshots (tabs, broken links, empty folders), regenerated README/site screenshot, social preview and marquee.
  • store/listing.md: justification for the optional host permission, release notes.

Testing

  • node --test: 18/18.
  • Playwright in headless Chromium, on both the source tree and the packaged zip:
    • Duplicates tab: the existing 21 checks.
    • New tabs, 30 checks:
      • tab counts, hash and arrow keys, smart switch only on Duplicates;
      • empty folders delete and undo, nested folder restored;
      • same-name merge and undo, with exact order and content restored;
      • broken links against a local server: 404/410/503/403/HEAD-405 and an .invalid domain;
      • deletion and undo of broken links;
      • no console errors.
  • Limitation: Chrome's real permission prompt cannot be clicked in headless tests, so chrome.permissions.request was stubbed; the local server sends CORS headers to stand in for the host permission.

Generated by Claude Code

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
Copilot AI balanced review requested due to automatic review settings October 19, 2026 10:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T10:37:56.686421Z 3f6612e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread tab-folders.js Resolved
Comment thread tab-folders.js Resolved
Comment thread tab-links.js Resolved
Comment thread links.js Resolved
Comment thread tab-folders.js Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tab-folders.js Resolved
- 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
@wiso
wiso merged commit ff4be75 into master Oct 19, 2026
3 checks passed
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.

Empty folders, same-name folders and broken links

3 participants