Skip to content

feat(sidebar): make stale tab expiration configurable - #33

Merged
moonrailgun merged 1 commit into
mainfrom
moonrailgun/slate-time
Jul 28, 2026
Merged

feat(sidebar): make stale tab expiration configurable#33
moonrailgun merged 1 commit into
mainfrom
moonrailgun/slate-time

Conversation

@moonrailgun

@moonrailgun moonrailgun commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Background

The stale-tab archive action previously used a fixed 24-hour cutoff. This change lets users configure the expiration window from Dao settings while keeping the sidebar action profile-scoped and defensively validated.

Changes

  • Add a profile pref for stale tab expiration hours with a 24-hour default.
  • Add a Settings Dao page number input for 1-720 hours with inline unit text and validation.
  • Pass the configured expiration from native sidebar command handling to the sidebar WebUI.
  • Update stale-tab archive logic to use the configured value and fall back to 24 hours for invalid payloads.
  • Update English and Simplified Chinese strings plus feature documentation/checklist entries.

Testing

Patch contains browser tests for the default pref and inline unit suffix, sidebar WebUI tests for configured and invalid expiration payloads, settings WebUI tests for valid/invalid input handling, and settings i18n coverage for Simplified Chinese strings.

Summary by CodeRabbit

  • New Features

    • Added configurable stale-tab expiration in You and Dao settings.
    • Supports integer values from 1–720 hours, with a default of 24 hours.
    • Invalid values are rejected and not saved.
    • Stale-tab archiving now uses the configured expiration and displays updated confirmation messaging.
    • Added localized settings labels and Simplified Chinese translations.
  • Documentation

    • Updated feature documentation and verification requirements.
  • Tests

    • Added coverage for validation, defaults, localized strings, and archiving behavior.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4395bb30-04c3-4966-aa7d-3819c4744838

📥 Commits

Reviewing files that changed from the base of the PR and between 9212bb4 and 0f2743e.

📒 Files selected for processing (18)
  • docs/feature-checklist.md
  • docs/features.md
  • scripts/commands/__tests__/settings_i18n.test.ts
  • src/dao/browser/dao_pref_names.cc
  • src/dao/browser/dao_pref_names.h
  • src/dao/browser/strings/dao_strings.grd
  • src/dao/browser/strings/translations/dao_strings_zh-CN.xtb
  • src/dao/browser/ui/views/dao_browser_browsertest.cc
  • src/dao/browser/ui/webui/dao_sidebar_ui.cc
  • src/dao/browser/ui/webui/resources/sidebar/__tests__/sidebar_app.test.ts
  • src/dao/browser/ui/webui/resources/sidebar/dao_sidebar_app.ts
  • src/patches/chrome/app/resources/generated_resources_zh-CN.xtb.patch
  • src/patches/chrome/app/settings_strings_dao.grdp.patch
  • src/patches/chrome/browser/extensions/api/settings_private/prefs_util.cc.patch
  • src/patches/chrome/browser/resources/settings/dao_page/dao_page.html.patch
  • src/patches/chrome/browser/resources/settings/dao_page/dao_page.ts.patch
  • src/patches/chrome/browser/ui/webui/settings/settings_localized_strings_provider_dao.cc.patch
  • src/patches/chrome/test/data/webui/settings/dao_page_test.ts.patch

📝 Walkthrough

Walkthrough

The change adds a profile-scoped stale-tab expiration preference defaulting to 24 hours, exposes it through the Dao settings page with 1–720 integer validation, passes it to sidebar archival logic, and adds localization, browser, WebUI, translation, and documentation coverage.

Changes

Configurable stale-tab expiration

Layer / File(s) Summary
Preference and Dao settings UI
src/dao/browser/dao_pref_names.*, src/patches/chrome/browser/resources/settings/dao_page/*, src/patches/chrome/browser/ui/webui/settings/*, src/patches/chrome/app/settings_strings_dao.grdp.patch, src/patches/chrome/test/data/webui/settings/dao_page_test.ts.patch, src/patches/chrome/app/resources/generated_resources_zh-CN.xtb.patch
Registers dao.stale_tab_expiration_hours with a default of 24, exposes it through settings, validates integer values from 1–720, persists valid changes, and tests default, valid, invalid, and suffix behavior.
Sidebar archival flow
src/dao/browser/ui/webui/dao_sidebar_ui.cc, src/dao/browser/ui/webui/resources/sidebar/dao_sidebar_app.ts, src/dao/browser/ui/webui/resources/sidebar/__tests__/sidebar_app.test.ts, src/dao/browser/ui/views/dao_browser_browsertest.cc, src/dao/browser/strings/*
Passes the configured expiration to the sidebar, normalizes invalid payloads to 24 hours, filters qualifying ordinary tabs, and updates archived-tab toast coverage.
Localization and feature verification
scripts/commands/__tests__/settings_i18n.test.ts, docs/feature-checklist.md, docs/features.md
Adds Simplified Chinese translation fixtures and verification, and documents the setting range, default, persistence rules, and stale-folder behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SettingsDaoPageElement
  participant ProfilePrefs
  participant DaoSidebarUIHandler
  participant dao_sidebar_app
  SettingsDaoPageElement->>ProfilePrefs: persist expiration hours
  DaoSidebarUIHandler->>ProfilePrefs: read expiration hours
  DaoSidebarUIHandler->>dao_sidebar_app: moveStaleTabsRequested(expiration_hours)
  dao_sidebar_app->>dao_sidebar_app: validate and normalize value
  dao_sidebar_app->>dao_sidebar_app: archive qualifying stale tabs
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch moonrailgun/slate-time

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@moonrailgun
moonrailgun force-pushed the moonrailgun/slate-time branch from 0abf485 to 0f2743e Compare July 28, 2026 16:30
@moonrailgun
moonrailgun merged commit a32ba76 into main Jul 28, 2026
1 check was pending
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