Skip to content

Update navigation bar button appearance and behaviour#511

Merged
KommunicateDeveloper merged 3 commits intodevfrom
fix-ios26-glass-effect
Oct 22, 2025
Merged

Update navigation bar button appearance and behaviour#511
KommunicateDeveloper merged 3 commits intodevfrom
fix-ios26-glass-effect

Conversation

@KommunicateDeveloper
Copy link
Contributor

@KommunicateDeveloper KommunicateDeveloper commented Oct 18, 2025

Summary

  • Adds tintColor customization for navigation bar buttons in FAQ and conversation list screens.
  • Sets hidesSharedBackground for navigation bar items on iOS 26+ to improve UI consistency.
  • Ensures back button and create conversation icon use configurable colors.

Testing Branches

KM_ChatUI_Branch : fix-ios26-glass-effect
KM_Core_Branch: dev

Summary by CodeRabbit

  • Style
    • Enhanced navigation button styling with customizable tint colors across conversation and FAQ screens.
    • Improved visual treatment of navigation bar buttons on iOS 26.0 and later for a cleaner interface appearance.

Adds tintColor customization for navigation bar buttons in FAQ and conversation list screens. Sets hidesSharedBackground for navigation bar items on iOS 26+ to improve UI consistency. Ensures back button and create conversation icon use configurable colors.
@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

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.

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

Walkthrough

Navigation bar button styling enhancements are applied across three view controllers to support custom tint colors and iOS 26.0+ specific background rendering. Changes include tintColor configuration for action buttons and a conditional suppression of shared background visuals via hidesSharedBackground on navigation items.

Changes

Cohort / File(s) Summary
Navigation Bar Button Styling Updates
Sources/Kommunicate/Classes/FaqViewController.swift, Sources/Kommunicate/Classes/KMConversationListViewController.swift, Sources/Kommunicate/Classes/KMConversationViewController.swift
Added tintColor customization for back buttons and action buttons using configuration-provided colors; introduced iOS 26.0+ conditional logic to iterate over navigation bar items and set hidesSharedBackground = true to suppress shared background visuals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent pattern across three files with straightforward additions of tintColor assignments and iOS version-conditional background suppression logic. Homogeneous changes applied repeatedly reduce cognitive load during review.

Poem

🐰 Buttons dressed in custom hues,
iOS twenty-six breaks through,
Backgrounds hide with quiet grace,
Navigation finds its place! 🎨✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Update navigation bar button appearance and behaviour" accurately captures the core changes across all three modified files. The term "appearance" aligns with the tintColor customization applied to back buttons and the create conversation icon, while "behaviour" refers to the iOS 26+ specific logic that sets hidesSharedBackground to suppress shared background visuals. The title is concise, avoids generic language or noise, and provides sufficient clarity for a reviewer scanning the commit history to understand the primary purpose of the changeset.

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.

@KommunicateDeveloper
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
Sources/Kommunicate/Classes/KMConversationListViewController.swift (1)

396-403: Consider extracting duplicated iOS 26+ configuration logic.

The same iOS 26+ hidesSharedBackground configuration block appears in multiple locations throughout this file. Extracting it to a helper method would improve maintainability and reduce the risk of inconsistencies.

private func applyIOS26BackgroundFix() {
    if #available(iOS 26.0, *) {
        navigationItem.rightBarButtonItems?.forEach {
            $0.hidesSharedBackground = true
        }
        navigationItem.leftBarButtonItems?.forEach {
            $0.hidesSharedBackground = true
        }
    }
}

Then call it after configuring navigation items:

func setupBackButton() {
    guard !configuration.hideBackButtonInConversationList else { return }
    
    if configuration.enableBackArrowOnConversationListScreen {
        let backArrowButton = getBackArrowButton(target: self, action: #selector(customBackAction))
        backArrowButton.tintColor = configuration.conversationListScreenBackButtonColor
        navigationItem.leftBarButtonItem = backArrowButton
    } else {
        let backTextButton = getBackTextButton(title: LocalizedText.leftBarBackButtonText, target: self, action: #selector(customBackAction))
        backTextButton.tintColor = configuration.conversationListScreenBackButtonColor
        navigationItem.leftBarButtonItem = backTextButton
    }
    applyIOS26BackgroundFix()
}

Also applies to: 434-441

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9c1a06 and d9f37d3.

📒 Files selected for processing (3)
  • Sources/Kommunicate/Classes/FaqViewController.swift (1 hunks)
  • Sources/Kommunicate/Classes/KMConversationListViewController.swift (4 hunks)
  • Sources/Kommunicate/Classes/KMConversationViewController.swift (1 hunks)
🔇 Additional comments (5)
Sources/Kommunicate/Classes/FaqViewController.swift (2)

82-85: LGTM!

The tint color customization is properly applied before assigning the button to the navigation item.


86-93: The script confirms that the code pattern at lines 86-93 is consistent throughout the codebase across multiple view controllers. All files follow the identical pattern of iterating over plural navigationItem.*BarButtonItems to set hidesSharedBackground after assigning bar button items.

However, there is a more significant concern: iOS 26.0 appears to be an incorrect version number. iOS 26 would be years in the future; current iOS versions are in the 18-19 range. This availability check should likely target an earlier iOS version (possibly iOS 16.0 or iOS 18.0, depending on when hidesSharedBackground was introduced).

Verify and correct the iOS availability version number. The current pattern of setting hidesSharedBackground on items after assignment is consistent with the established codebase approach and functions correctly through UIKit's automatic synchronization between singular and plural properties. The pattern itself is sound, but the version targeting requires clarification.

Sources/Kommunicate/Classes/KMConversationListViewController.swift (3)

116-116: LGTM!

Tint color is properly configured during the bar button item initialization.


384-403: LGTM!

The button creation, tint color customization, and iOS 26+ background configuration follow the correct sequence. The bar button items are properly configured before the hidesSharedBackground property is set.


434-441: LGTM!

The iOS 26+ background configuration is correctly placed after the navigation bar button items are assigned to the navigation item.

Replaced repeated iOS 26 navigation bar button background hiding logic with a new helper method, configureNavigationBarButtonsForIOS26, in KMConversationListViewController and KMConversationViewController. This improves code maintainability and reduces duplication.
Relocated the call to configureNavigationBarButtonsForIOS26() within KMConversationViewController to ensure navigation bar buttons are set after updating the assignee details and custom navigation view.
@KommunicateDeveloper KommunicateDeveloper merged commit 99eac72 into dev Oct 22, 2025
2 of 3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 22, 2025
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