Skip to content

Conversation

@RyanRory
Copy link
Owner

No description provided.

import Lucide
import Combine

public struct UserProfileModel: View {

Choose a reason for hiding this comment

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

Should this be UserProfileModal?

case (.some(let sessionId), .none):
return ("accountId".localized(), sessionId)
case (.some(let sessionId), .some(_)):
return ("accountId".localized(), sessionId.splitIntoLines(charactersForLines: [23, 23, 20]))

Choose a reason for hiding this comment

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

I can't remember what the resolution was but I think Thomas mentioned that could be a problem if we (eventually) support dynamic font sizes - ie. is this going to break if a use increases the size to the max?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, this is not the perfect design rules as the screen width can change and the font on iOS can have different character width than the design file. Normally we should make it wrap naturally, but I checked the chat history on this and we eventually agreed on applying the rules and using it as a "hope for the best" approach.
There are other rules like 33-33 I couldn't apply because it is already broken on normal iPhone 16 screen. If I have to argue, I'll say we shouldn't have these rules and just let it wrap naturally with proper paddings.

switch (info.sessionId, info.blindedId) {
case (.some(let sessionId), .none):
return ("accountId".localized(), sessionId)
case (.some(let sessionId), .some(_)):

Choose a reason for hiding this comment

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

You can omit the (_) in the .some case here - case (.some(let sessionId), .some):

return ("accountId".localized(), sessionId.splitIntoLines(charactersForLines: [23, 23, 20]))
case (.none, .some(let blindedId)):
return ("blindedId".localized(), blindedId)
default : return ("", "") // Shouldn't happen

Choose a reason for hiding this comment

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

Might be better to explicitly handle case (.none, .none) here instead of default in case the info.sessionId type changes to something that has additional cases (in which case we would want it to throw a build error so we can resolve it)

withAnimation(.easeInOut(duration: 0.25)) {
isSessionIdCopied.toggle()
}
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(4250)) {

Choose a reason for hiding this comment

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

Where does the 4250 come from?

Comment on lines 421 to 439
struct ConditionalTruncation: ViewModifier {
let shouldTruncate: Bool

func body(content: Content) -> some View {
if shouldTruncate {
content
.lineLimit(1)
.truncationMode(.middle)
} else {
content
}
}
}

extension View {
func shouldTruncate(_ condition: Bool) -> some View {
modifier(ConditionalTruncation(shouldTruncate: condition))
}
}

Choose a reason for hiding this comment

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

Just wondering whether this should be in it's own file? (ie. do you think we might use it elsewhere at some point?)

Comment on lines 86 to 97
var backgroundColor: UIColor {
switch themeStyle {
case .light: return #colorLiteral(red: 0.1058823529, green: 0.1058823529, blue: 0.1058823529, alpha: 1)
default: return .white
}
}
var tintColor: UIColor {
switch themeStyle {
case .light: return .white
default: return #colorLiteral(red: 0.1058823529, green: 0.1058823529, blue: 0.1058823529, alpha: 1)
}
}

Choose a reason for hiding this comment

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

Should these literals be constants in Theme+Colours?


for count in charactersForLines {
let end = self.index(start, offsetBy: count, limitedBy: self.endIndex) ?? self.endIndex
var line = String(self[start..<end])

Choose a reason for hiding this comment

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

Will this crash if called on an empty string? (I think ..< has issues if start == end)

Copy link
Owner Author

Choose a reason for hiding this comment

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

It won't crash when start == end. Only when start > end will it crash because of Swift precondition check failure


VStack(spacing: 0) {
content{ close() }
content { completion in close(completion: completion) }

Choose a reason for hiding this comment

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

😵‍💫

# Conflicts:
#	Session.xcodeproj/project.pbxproj
mpretty-cyro pushed a commit that referenced this pull request Sep 19, 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.

4 participants