Update navigation bar button appearance and behaviour#511
Update navigation bar button appearance and behaviour#511KommunicateDeveloper merged 3 commits intodevfrom
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughNavigation 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 Changes
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
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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+
hidesSharedBackgroundconfiguration 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
📒 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 pluralnavigationItem.*BarButtonItemsto sethidesSharedBackgroundafter 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
hidesSharedBackgroundwas introduced).Verify and correct the iOS availability version number. The current pattern of setting
hidesSharedBackgroundon 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
hidesSharedBackgroundproperty 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.
Sources/Kommunicate/Classes/KMConversationListViewController.swift
Outdated
Show resolved
Hide resolved
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.
Summary
Testing Branches
KM_ChatUI_Branch :
fix-ios26-glass-effectKM_Core_Branch:
devSummary by CodeRabbit