Skip to content

Add theme-configurable collapsible privacy notice - #214

Merged
josej-ea merged 2 commits into
devfrom
feature/privacy-notice-collapse-dev
Nov 19, 2026
Merged

josej-ea merged 2 commits into
devfrom
feature/privacy-notice-collapse-dev

Conversation

@josej-ea

Copy link
Copy Markdown
Collaborator

Summary

Add opt-in inline collapse for the conversation privacy notice so lengthy privacy copy does not dominate the chat.

  • Set behavior.privacyNotice.presentation to "collapsible" to start with a compact notice.
  • Show an optional authored summary, or a line-limited preview controlled by collapsedMaxLines (default: 3).
  • Expand the full notice in place with Read more, pushing subsequent conversation content down; restore the preview with Show less.
  • Hide the toggle when an unsummarized notice fits within the preview.
  • Preserve existing link routing and tracking in the expanded notice.
  • Provide configurable button labels, accessibility state descriptions, and accessible touch targets.
  • Preserve existing fully expanded behavior when presentation is omitted or "inline".
  • Update theme documentation and enable sample copy in the SDK demo theme.

The notice remains informational: it does not collect consent or block conversation submission.

Configuration

{
  "behavior": {
    "privacyNotice": {
      "title": "Privacy Notice",
      "text": "Full approved privacy copy...",
      "presentation": "collapsible",
      "collapsedMaxLines": 3
    }
  }
}

Optional keys: summary, readMoreLabel, and showLessLabel.

Validation

  • 156 focused unit tests passed: privacy configuration/placement, theme parsing, citation annotation, and feedback icon tint.
  • 16 focused emulator UI tests passed: privacy expansion/collapse and content reflow, feedback icon colors, and citation visibility.
  • Android sample app assembled, installed, and launched against this branch with the Kings theme.
  • :concierge:spotlessCheck and git diff --check passed.

The installed API 36 emulator required a temporary AndroidX Test/Espresso runtime override for instrumentation tests. This was local test configuration only; no shipping or repository dependency versions were changed.

Scope

Based on dev, including PRs #210 and #211. This PR contains only the privacy enhancement, its tests, SDK demo configuration, and documentation; external sample-app changes are not included.

- Add opt-in inline expansion with Read more and Show less controls
- Support an optional summary or configurable line-limited preview
- Show expansion controls only when additional content exists
- Preserve linked text in the expanded notice
- Keep existing notices fully expanded by default
- Add accessibility support, tests, documentation, and demo configuration
Keep Show less visible whenever the notice is expanded, even when
the overflow flag resets after state restoration or lazy-list disposal.

Add regression tests for both scenarios, verifying that the notice
stays expanded and can still be collapsed.
@josej-ea

Copy link
Copy Markdown
Collaborator Author

Addressed the missing Show less control after state restoration or lazy-list item disposal in commit f803a33.

The toggle now remains available whenever the privacy notice is expanded, regardless of the reset overflow flag. Added two regression tests without a summary: one for saved-state restoration and one that verifies the lazy item actually leaves composition before returning. Both reproduce the failure on the original code and pass with the correction. All 11 privacy UI tests passed locally, along with spotlessCheck and git diff --check.

Saved-state restoration was tested programmatically; a manual toolbar rotation was not performed. No theme or dependency changes are included.

@josej-ea
josej-ea requested a review from BNanda99 November 19, 2026 14:35
@josej-ea
josej-ea merged commit 81ebd87 into dev Nov 19, 2026
16 of 18 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.

2 participants