Skip to content

TDH-3754: Adding Configuration for FAQ#657

Open
adarshmishra wants to merge 3 commits into
developmentfrom
TDH-3754_FAQ_Customization
Open

TDH-3754: Adding Configuration for FAQ#657
adarshmishra wants to merge 3 commits into
developmentfrom
TDH-3754_FAQ_Customization

Conversation

@adarshmishra
Copy link
Copy Markdown
Contributor

Title
FAQ WebView: add configurable status-bar visibility, decouple toolbar behavior, and fix form action formatting

Summary
This PR improves FAQ/Helpcenter rendering behavior in KmWebViewActivity and adds a new customization setting to control FAQ status-bar visibility without breaking existing integrations.

Problem

  • FAQ fullscreen behavior needed a dedicated control for status bar visibility.
  • Toolbar visibility was unintentionally coupled with status-bar visibility.
  • webViewClientPost() built form HTML with String.format(FORMID_ACTION) but did not pass required %s arguments.

What changed

  1. New FAQ setting
  • Added showStatusBarOnFaqPage in CustomizationSettings.
  • Added getter: isShowStatusBarOnFaqPage().
  1. Backward-compatible default
  • Default is set to true to preserve existing behavior for clients that don’t provide this key in JSON.
  1. FAQ status-bar handling in KmWebViewActivity
  • Detect FAQ/helpcenter flow via KM_HELPCENTER_URL.
  • Apply status-bar visibility using WindowInsetsControllerCompat + fullscreen window flag handling.
  • Re-apply hide state in lifecycle callbacks (onWindowFocusChanged, onResume) for device consistency.
  1. Decoupled toolbar behavior
  • FAQ toolbar visibility now depends only on showBackButtonOnFaqPage.
  • Status-bar visibility now depends only on showStatusBarOnFaqPage.
  1. Form markup bug fix
  • Fixed:
    • from: String.format(FORMID_ACTION)
    • to: String.format(FORMID_ACTION, url, "post")
  • This prevents malformed format usage and ensures valid HTML form action/method generation.
  1. Related rich message image robustness
  • In ListKmRichMessage, header image loading now falls back from headerImgSrc to headerImageUrl and still appends SAS token.

Behavior matrix

  • showBackButtonOnFaqPage=true, showStatusBarOnFaqPage=true
    • Toolbar visible, status bar visible (existing-like behavior).
  • showBackButtonOnFaqPage=false, showStatusBarOnFaqPage=true
    • Toolbar hidden, status bar visible.
  • showBackButtonOnFaqPage=true, showStatusBarOnFaqPage=false
    • Toolbar visible, status bar hidden.
  • showBackButtonOnFaqPage=false, showStatusBarOnFaqPage=false
    • Toolbar hidden, status bar hidden.

Compatibility

  • Non-breaking: new setting defaults to true.
  • Existing customers with no new JSON key keep prior status-bar behavior.

Files changed

  • kommunicateui/src/main/java/io/kommunicate/ui/CustomizationSettings.java
  • kommunicateui/src/main/java/io/kommunicate/ui/conversation/richmessaging/webview/KmWebViewActivity.java
  • kommunicateui/src/main/java/io/kommunicate/ui/conversation/richmessaging/types/ListKmRichMessage.java

Validation

  • Compiled successfully:
    • ./gradlew :kommunicateui:compileDebugJavaWithJavac

Config usage (optional for consumers)

{
  "showBackButtonOnFaqPage": false,
  "showStatusBarOnFaqPage": false
}

- Bug fix for form action
- Token for Img Header
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5621dbde-42c8-4fee-aa82-37e3c013fc62

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch TDH-3754_FAQ_Customization

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 and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d3674aba0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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