Skip to content

feat: add configurable cookie notice - #4

Merged
bao-cn merged 6 commits into
mainfrom
feat/cookie-notice
Aug 16, 2026
Merged

feat: add configurable cookie notice#4
bao-cn merged 6 commits into
mainfrom
feat/cookie-notice

Conversation

@bao-cn

@bao-cn bao-cn commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

Implement the configurable first-visit cookie and local-storage notice in the terminal.

Implementation

  • Add cookieNotice.enable and message configuration support.
  • Preserve compatibility with the legacy string configuration.
  • Prompt at the end of terminal scrollback when no stored decision exists.
  • Persist y, n, and Ctrl+C decisions in localStorage.
  • Add configuration, consent-state, and terminal behavior tests.

Behavior and compatibility

The notice is disabled when cookieNotice.enable is false. Existing string-form cookieNotice values remain supported. This PR depends on refactor/config-path.

Risk

The main risk is repeated prompting or incorrect consent persistence; focused tests cover parsing and storage behavior.

Verification

npx prettier --check .
npm run lint
npx tsc --noEmit --incremental false
npm test
npm run build

All checks passed, including desktop and mobile browser interaction checks.

Checklist

  • The change is focused.
  • Runtime validation, tests, configuration examples, and documentation are updated.
  • No sensitive browser data is read or transmitted.

@bao-cn
bao-cn merged commit 01aa9ae into main Aug 16, 2026
2 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.

1 participant