Skip to content

feat(share-prompt): add power‑user share prompt for >100 messages - #731

Merged
haiphucnguyen merged 4 commits into
mainfrom
feature/improvements
Sep 23, 2026
Merged

haiphucnguyen merged 4 commits into
mainfrom
feature/improvements

Conversation

@haiphucnguyen

Copy link
Copy Markdown
Collaborator
  • Introduce POWER_USER_MESSAGE_THRESHOLD and logic in AccountPreferences
  • Extend StarPromptDialog to show the new share prompt card
  • Update Main to display the prompt and emit analytics events

Summary

Related Issue(s)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📝 Documentation
  • ♻️ Refactor (no functional change)
  • 🧪 Tests
  • 🔧 Chore / tooling / CI

What Changed & Why

How to Test

./gradlew test

Screenshots / Recordings (if applicable)

Checklist

  • I have read the CONTRIBUTING guide
  • My branch is up to date with main
  • I ran ./gradlew spotlessApply and ./gradlew detekt locally
  • I ran ./gradlew test and all tests pass
  • I added/updated tests for my changes (if applicable)
  • I added/updated documentation (if applicable)
  • My commits are signed off (DCO) — git commit -s
  • This PR is focused on a single feature/fix

Additional Notes

- Introduce POWER_USER_MESSAGE_THRESHOLD and logic in AccountPreferences
- Extend StarPromptDialog to show the new share prompt card
- Add i18n strings for the prompt in all locales
- Update Main to display the prompt and emit analytics events
- Add SHARE_PROMPT_SHOWN and SHARE_PROMPT_ACCEPTED events
- Add countByRole to ChatMessageRepository for role-based analytics
Copilot AI lite review requested due to automatic review settings September 23, 2026 22:12

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.

Copilot review overview

🟡 Changes recommended

Unresolved state-handling and copy issues remain, along with requested test coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds a power-user share prompt after 100 user messages, with persistent state, analytics, UI, and localized copy.

Changes:

  • Counts user messages and manages share-prompt preferences.
  • Adds desktop prompt UI and analytics events.
  • Updates localized strings and feedback behavior.
File Summary Review notes
shared/​src/​main/​kotlin/​io/​askimo/​core/​chat/​repository/​ChatMessageRepository.kt Counts messages by role. Nit (1 vote): add cross-session aggregate-query coverage.
shared/​src/​main/​kotlin/​io/​askimo/​core/​analytics/​AnalyticsEvent.kt Adds share and feedback analytics events. —
desktop/​src/​main/​kotlin/​io/​askimo/​desktop/​Main.kt Displays prompts and tracks actions. Moderate (1 vote): use a separate share thank-you callback so sharing does not mark users as having starred.
desktop-shared/​src/​main/​resources/​i18n/​messages.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_zh_TW.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_zh_CN.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_vi_VN.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_pt_BR.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_ko_KR.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_ja_JP.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_fr.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_es.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​resources/​i18n/​messages_de.properties Adds localized share-prompt text. —
desktop-shared/​src/​main/​kotlin/​io/​askimo/​ui/​shell/​StarPromptDialog.kt Adds share prompt UI. Moderate (2 votes): use share-specific reminder copy instead of directing users to the star prompt.
desktop-shared/​src/​main/​kotlin/​io/​askimo/​ui/​common/​preferences/​AccountPreferences.kt Manages share-prompt state. Moderate (2 votes): define migration behavior for existing positive users. Nit (2 votes): add threshold and state-transition tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Copilot review overview

🟡 Changes recommended

Unresolved critical and moderate eligibility, threshold, snooze-boundary, and message-count issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (3)
Previously missed (1)

In code that hasn't changed since last review

Low severity Missing integration coverage for role-based message counts

shared/​src/​main/​kotlin/​io/​askimo/​core/​chat/​repository/​ChatMessageRepository.kt:241

This new aggregate directly controls both prompt gates, but ChatMessageRepositoryIT currently has role-handling tests and no coverage for countByRole. Add an integration test covering an empty table, mixed roles, and messages in multiple sessions so a broken role predicate or aggregate cannot silently suppress or over-trigger the prompt.

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.

Copilot review overview

🟡 Changes recommended

Unresolved eligibility, feedback-state, startup-scan, and repository-test issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Low severity Missing repository tests for role-filtered message counts

shared/​src/​main/​kotlin/​io/​askimo/​core/​chat/​repository/​ChatMessageRepository.kt:241

The new count is the input that decides whether the milestone prompt appears, but the repository integration tests do not cover this method. Add a repository test with USER, ASSISTANT, and SYSTEM rows (and an empty table) to verify that the role filter and zero-count behavior match the prompt's definition.

@haiphucnguyen
haiphucnguyen merged commit c391d8d into main Sep 23, 2026
8 of 10 checks passed
@haiphucnguyen
haiphucnguyen deleted the feature/improvements branch September 23, 2026 22:54
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.

2 participants