Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Unified Customization to Persistent Button #687

Merged

Conversation

rasmustautsglia
Copy link
Contributor

This PR adds Unified customization to Persistent button, together with default theme. In GVAPersistentButtonVIew the ContainerView was moved to a stand-alone class so layoutSubviews() could be used properly, since gradient color can only be applied in that method.

In addition, it adds system message to unified customization since it wasn't applied before but was actually ready to be used.

MOB-2372

Comment on lines 356 to 357
let gvaStyle = gvaStyle

Copy link
Contributor

Choose a reason for hiding this comment

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

could we pass gvaStyle directly to ChatStyle without this local variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 52e93dc

Comment on lines 1 to 3
import UIKit
extension Theme {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import UIKit
extension Theme {
import UIKit
extension Theme {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 52e93dc

public var systemMessage: SystemMessageStyle

/// Style of the GVA
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to propose using full name of the feature instead of GVA, would it make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean in this descriptive line or in general gva -> Glia Virtual Assistant?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would also like if it says Glia Virtual Assistant, especially here that it's a comment to help the future reader.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed a4db754

@rasmustautsglia
Copy link
Contributor Author

!squash

@sm-deployer sm-deployer force-pushed the Apply-Unified-Customization-to-persistent-button branch from a4db754 to e1bd634 Compare July 20, 2023 07:07
isa = PBXGroup;
children = (
C0175A162A5D30D7001FACDE /* GvaResponseTextView.swift */,
C0175A222A65614E001FACDE /* GVAPersistentButtonView.swift */,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think files need to be called Gva... rather than GVA... because of some issue with Swift Package Manager or Xcfs or something like that. Same with the Theme+Gva

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed 1128e9a

backgroundColor: .clear
),
backgroundColor: .fill(color: color.lightGrey),
cornerRadius: 8.49,
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why we have these super precise corner radiuses? :D I guess they are part of Figma, but perhaps in other places we do them with round numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will ask about it from Aksel

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2023-07-20 at 10 45 16 Screenshot 2023-07-20 at 10 49 37

If I'm not mistaken, cornerRadius for PB is 5, and radius for the card is 8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-07-20 at 11 06 34 Screenshot 2023-07-20 at 11 07 03

I honestly don't know, because I was relying on this section instead

Copy link
Contributor

Choose a reason for hiding this comment

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

I would not suggest to rely on Code section at all)
Usually it suggests useless awful code)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporary fix is 10px as disgussed with Yaro. Changed in 2596c15

@@ -90,7 +94,8 @@ public class ChatStyle: EngagementStyle {
secureTranscriptTitle: String,
secureTranscriptHeader: HeaderStyle,
unreadMessageDivider: UnreadMessageDividerStyle,
systemMessage: SystemMessageStyle
systemMessage: SystemMessageStyle,
gva: GvaStyle
Copy link
Contributor

Choose a reason for hiding this comment

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

I am worried about this for the future. If someone else comes and reads gva, they will not understand. However having this called gliaVirtualAssistantStyle is long-ish. Don't know exactly what to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is indeed more descriptive. I will change it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed 1128e9a

@@ -9,7 +9,7 @@ final class GvaPersistentButtonView: OperatorChatMessageView {
private let environment: Environment

init(with style: ChatStyle, environment: Environment) {
self.viewStyle = style.gva.persistentButton
self.viewStyle = style.gliaVirtualAssistant.persistentButton
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a SwiftLint issue on this file, at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed c853494

@rasmustautsglia
Copy link
Contributor Author

!squash

This PR adds Unified customization to Persistent button, together with
default theme. In GVAPersistentButtonVIew the ContainerView was moved to
a stand-alone class so layoutSubviews() could be used properly, since
gradient color can only be applied in that method.

In addition, it adds system message to unified customization
since it wasn't applied before but was actually ready to be used.

MOB-2372
@sm-deployer sm-deployer force-pushed the Apply-Unified-Customization-to-persistent-button branch from 2596c15 to 2f32a34 Compare July 20, 2023 09:01
@rasmustautsglia rasmustautsglia merged commit 9d397f5 into development Jul 20, 2023
1 check passed
@rasmustautsglia rasmustautsglia deleted the Apply-Unified-Customization-to-persistent-button branch July 20, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants