Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@
}
}
}
},
"Configure Quick Action" : {

},
"Confirm clearing history" : {
"localizations" : {
Expand Down Expand Up @@ -347,6 +350,9 @@
}
}
}
},
"Create or edit a Quick Action" : {

},
"Date" : {
"localizations" : {
Expand Down Expand Up @@ -407,6 +413,12 @@
}
}
}
},
"Edit message" : {

},
"Edit Typeahead's message" : {

},
"Edit your email by clicking the edit button next to the Typeahead response. Press **Enter** to save or **Shift-Enter** for a new line.\n\nAlternatively, you can type feedback like \"make it more concise\" or \"more casual,\" and it will provide a revised draft.\n\nIf you want it to remember detailed instructions for the future, you can click on the wrench icon to configure a Quick Action.\n\nClick continue when you're satisfied." : {
"localizations" : {
Expand All @@ -417,6 +429,9 @@
}
}
}
},
"Edit your previous message" : {

},
"Email" : {
"localizations" : {
Expand Down Expand Up @@ -1095,6 +1110,9 @@
}
}
}
},
"Retry" : {

},
"Sample Input" : {
"localizations" : {
Expand Down
8 changes: 8 additions & 0 deletions TypeaheadAI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@
path = Onboarding;
sourceTree = "<group>";
};
2B79DFB42B4CA75A0038E577 /* New Group */ = {
isa = PBXGroup;
children = (
);
path = "New Group";
sourceTree = "<group>";
};
2B7BBABE2AF2B47900E4CE1F /* QuickActions */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -539,6 +546,7 @@
isa = PBXGroup;
children = (
2B92BDBA2AA3D10800E65CFA /* ModalManager.swift */,
2B79DFB42B4CA75A0038E577 /* New Group */,
2B92BDB82AA3A2DD00E65CFA /* CustomModalWindow.swift */,
2B0B301A2ADE8E2A00338B76 /* SettingsManager.swift */,
2BAA97902B0366C400EC6A63 /* OnboardingWindowManager.swift */,
Expand Down
6 changes: 5 additions & 1 deletion TypeaheadAI/Traits/CanGetUIElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ extension CanGetUIElements {
element = AXUIElementCreateApplication(pid)

// Narrow down to the first (top-most) window
if let windowElement = element?.children().first(where: {
if NSWorkspace.shared.isVoiceOverEnabled,
let focusedElement = element?.subelement(forAttribute: kAXFocusedUIElementAttribute) {
// This works when VoiceOver is enabled
element = focusedElement
} else if let windowElement = element?.children().first(where: {
$0.stringValue(forAttribute: kAXRoleAttribute) == "AXWindow" &&
!$0.children().isEmpty
}) {
Expand Down
2 changes: 2 additions & 0 deletions TypeaheadAI/Views/Modal/ConversationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ struct ConversationView: View {
}
)
.id(message.id.uuidString)
.accessibilityElement(children: .contain)
.accessibilityAddTraits(.isHeader)
.padding(3)
}
}
Expand Down
23 changes: 20 additions & 3 deletions TypeaheadAI/Views/Modal/Message/ChatBubble.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,20 @@ struct ChatBubble<Content>: View where Content: View {
HStack(alignment: .bottom) {
Spacer()

userButtons
.padding(.leading, 10)

content()
.accessibilityHeading(.h1)
.clipShape(ChatBubbleShape(direction: direction))

userButtons
.padding(.trailing, 10)
}
}

@ViewBuilder
var aiMessage: some View {
HStack(alignment: .bottom) {
content()
.accessibilityHeading(.h1)
.clipShape(ChatBubbleShape(direction: direction))

aiButtons
Expand All @@ -75,6 +77,10 @@ struct ChatBubble<Content>: View where Content: View {
.padding(.bottom, 10)
})
.buttonStyle(.plain)
.accessibilityElement()
.accessibilityLabel("Edit message")
.accessibilityHint("Edit Typeahead's message")
.accessibilityAddTraits(.isButton)
}

if let onButtonDown = onRefresh {
Expand All @@ -85,6 +91,9 @@ struct ChatBubble<Content>: View where Content: View {
.padding(.bottom, 8)
})
.buttonStyle(.plain)
.accessibilityElement()
.accessibilityLabel("Retry")
.accessibilityAddTraits(.isButton)
}
}
}
Expand All @@ -100,6 +109,10 @@ struct ChatBubble<Content>: View where Content: View {
})
.padding(.bottom, 10)
.buttonStyle(.plain)
.accessibilityElement()
.accessibilityLabel("Edit message")
.accessibilityHint("Edit your previous message")
.accessibilityAddTraits(.isButton)
}

if let onConfigure = onConfigure {
Expand All @@ -110,6 +123,10 @@ struct ChatBubble<Content>: View where Content: View {
}
.buttonStyle(.plain)
.padding(.bottom, 7)
.accessibilityElement()
.accessibilityLabel("Configure Quick Action")
.accessibilityHint("Create or edit a Quick Action")
.accessibilityAddTraits(.isButton)
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions TypeaheadAI/Views/Modal/ModalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ struct ModalView: View {
}
}
} else {
if modalManager.messages.isEmpty {
RecentConversationsView(modalManager: modalManager)
} else {
ConversationView(modalManager: modalManager)
}
ConversationView(modalManager: modalManager)

if let lastMessage = modalManager.messages.last,
!lastMessage.isCurrentUser,
Expand Down