Another tweak for the string linter and a couple of UI fixes

Fixed a minor UI bug with the ProfilePictureView when in a SessionCell
Fixed a height calculation issue on the EditClosedGroupVC
This commit is contained in:
Morgan Pretty 2023-05-31 17:26:43 +10:00
parent 6209f2b5c1
commit 613dbb4afa
4 changed files with 24 additions and 23 deletions

View File

@ -15,25 +15,30 @@ let currentPath = (
/// List of files in currentPath - recursive
var pathFiles: [String] = {
guard
let enumerator = fileManager.enumerator(atPath: currentPath),
let files = enumerator.allObjects as? [String]
let enumerator: FileManager.DirectoryEnumerator = fileManager.enumerator(
at: URL(fileURLWithPath: currentPath),
includingPropertiesForKeys: [.isDirectoryKey],
options: [.skipsHiddenFiles]
),
let fileUrls: [URL] = enumerator.allObjects as? [URL]
else { fatalError("Could not locate files in path directory: \(currentPath)") }
return files
return fileUrls
.filter {
!$0.starts(with: ".") && // Exclude hidden files (.git, .DS_STORE, etc.)
!$0.contains("Pods/") && // Exclude files under the pods folder
!$0.contains(".xcassets") && // Exclude asset bundles
!$0.contains(".app/") && // Exclude files in the app build directories
!$0.contains(".appex/") && // Exclude files in the extension build directories
!$0.localizedCaseInsensitiveContains("tests/") && // Exclude files under test directories
!$0.localizedCaseInsensitiveContains("external/") && ( // Exclude files under external directories
((try? $0.resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory == false) && // No directories
!$0.path.contains("Pods/") && // Exclude files under the pods folder
!$0.path.contains(".xcassets") && // Exclude asset bundles
!$0.path.contains(".app/") && // Exclude files in the app build directories
!$0.path.contains(".appex/") && // Exclude files in the extension build directories
!$0.path.localizedCaseInsensitiveContains("tests/") && // Exclude files under test directories
!$0.path.localizedCaseInsensitiveContains("external/") && ( // Exclude files under external directories
// Only include relevant files
$0.hasSuffix("Localizable.strings") ||
NSString(string: $0).pathExtension == "swift" ||
NSString(string: $0).pathExtension == "m"
$0.path.hasSuffix("Localizable.strings") ||
NSString(string: $0.path).pathExtension == "swift" ||
NSString(string: $0.path).pathExtension == "m"
)
}
.map { $0.path }
}()

View File

@ -301,7 +301,7 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
}
private func handleMembersChanged() {
tableViewHeightConstraint.constant = CGFloat(membersAndZombies.count) * 72
tableViewHeightConstraint.constant = CGFloat(membersAndZombies.count) * 78
tableView.reloadData()
}
@ -440,7 +440,6 @@ final class EditClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegat
}
let threadId: String = self.threadId
let threadVariant: SessionThread.Variant = self.threadVariant
let updatedName: String = self.name
let userPublicKey: String = self.userPublicKey
let updatedMemberIds: Set<String> = self.membersAndZombies

View File

@ -55,10 +55,10 @@ extension SessionCell {
highlightingBackgroundLabel.pin(.trailing, to: .trailing, of: self, withInset: -Values.smallSpacing),
highlightingBackgroundLabel.pin(.bottom, to: .bottom, of: self)
]
private lazy var profilePictureViewLeadingConstraint: NSLayoutConstraint = profilePictureView.pin(.leading, to: .leading, of: self)
private lazy var profilePictureViewTrailingConstraint: NSLayoutConstraint = profilePictureView.pin(.trailing, to: .trailing, of: self)
private lazy var profilePictureViewConstraints: [NSLayoutConstraint] = [
profilePictureView.pin(.top, to: .top, of: self),
profilePictureView.pin(.leading, to: .leading, of: self),
profilePictureView.pin(.trailing, to: .trailing, of: self),
profilePictureView.pin(.bottom, to: .bottom, of: self)
]
private lazy var searchBarConstraints: [NSLayoutConstraint] = [
@ -269,8 +269,6 @@ extension SessionCell {
radioBorderViewHeightConstraint.isActive = false
radioBorderViewConstraints.forEach { $0.isActive = false }
highlightingBackgroundLabelConstraints.forEach { $0.isActive = false }
profilePictureViewLeadingConstraint.isActive = false
profilePictureViewTrailingConstraint.isActive = false
profilePictureViewConstraints.forEach { $0.isActive = false }
searchBarConstraints.forEach { $0.isActive = false }
buttonConstraints.forEach { $0.isActive = false }
@ -458,10 +456,6 @@ extension SessionCell {
fixedWidthConstraint.constant = profileSize.viewSize
fixedWidthConstraint.isActive = true
profilePictureViewLeadingConstraint.constant = (profileSize.viewSize > AccessoryView.minWidth ? 0 : Values.smallSpacing)
profilePictureViewTrailingConstraint.constant = (profileSize.viewSize > AccessoryView.minWidth ? 0 : -Values.smallSpacing)
profilePictureViewLeadingConstraint.isActive = true
profilePictureViewTrailingConstraint.isActive = true
profilePictureViewConstraints.forEach { $0.isActive = true }
case .search(let placeholder, let accessibility, let searchTermChanged):

View File

@ -640,6 +640,9 @@ extension MessageReceiver {
}
}
// Ensure the group still exists before inserting the info message
guard ClosedGroup.filter(id: threadId).isNotEmpty(db) else { return }
// Insert the info message for this group control message
_ = try Interaction(
serverHash: message.serverHash,