Scribe-Android icon indicating copy to clipboard operation
Scribe-Android copied to clipboard

feat: Add ClipboardDataManager for clipboard history storage

Open shrimpnaur opened this issue 2 weeks ago • 4 comments

Contributor checklist

  • [x] This pull request is on a separate branch and not the main branch
  • [x] I have tested my code with the ./gradlew lintKotlin detekt test command as directed in the testing section of the contributing guide

Description

This PR implements the data storage layer for the clipboard history feature (Issue #459).

Changes Made:

  • Created ClipboardDataManager class that manages clipboard item storage using SQLite
  • Implemented full CRUD operations: insert, retrieve (latest/pinned), pin/unpin, delete, clear, and time-based expiration
  • Added duplicate prevention to avoid storing consecutive identical clipboard items
  • Created ClipboardDataManagerTest with comprehensive test coverage for all operations
  • Integrated ClipboardDataManager into the DatabaseManagers, following the existing patterns

Testing:

  • All unit tests pass via ./gradlew test
  • Detekt and ktlint checks pass
  • Tests verify insert, retrieve, pin/unpin, delete, and expiration functionality

This is PR #1 from the following PRs (forming different parts of the implementation)

  1. Data Storage Layer (this PR)
  2. Clipboard Monitoring (next)
  3. UI Components
  4. Full Keyboard Integration

Related issue

  • #459

shrimpnaur avatar Nov 20 '25 15:11 shrimpnaur

Thank you for the pull request! 💙

The Scribe-Android team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest that you use the Element client as well as Element X for a mobile app, and definitely join the General and Android rooms once you're in. Also consider attending our bi-weekly Saturday dev syncs. It'd be great to meet you 😊

[!NOTE] Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

github-actions[bot] avatar Nov 20 '25 15:11 github-actions[bot]

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • [x] The linting, formatting and testing workflows within the PR checks do not indicate new errors in the files changed

    • Tests may need to be reran as they're at times not deterministic
  • [x] The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

github-actions[bot] avatar Nov 20 '25 15:11 github-actions[bot]

Hey @shrimpnaur 👋 Thanks so much for the PR! Could we ask that you fix the license headers and KTLint issues? You can also set up pre-commit as directed in the readme/contributing guide to check these rules on commit :)

andrewtavis avatar Nov 20 '25 17:11 andrewtavis

Thanks so much, @shrimpnaur! We'll try to get to the review in the coming days :)

andrewtavis avatar Nov 22 '25 10:11 andrewtavis