Skip to content

Commit

Permalink
chat: improve accessibility fields (#1532)
Browse files Browse the repository at this point in the history
Co-authored-by: cebtenzzre <[email protected]>
  • Loading branch information
vick08 and cebtenzzre authored Oct 21, 2023
1 parent d50803f commit 721d854
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 63 deletions.
40 changes: 20 additions & 20 deletions gpt4all-chat/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ Window {
highlighted: comboBox.highlightedIndex === index
}
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the current model")
Accessible.description: qsTr("Use this for picking the current model to use; the first item is the current model")
Accessible.name: qsTr(List of available models"")
Accessible.description: qsTr(" The top item is the current model")
onActivated: function (index) {
currentChat.stopGenerating()
currentChat.reset();
Expand All @@ -307,7 +307,7 @@ Window {
running: parent.visible
Accessible.role: Accessible.Animation
Accessible.name: qsTr("Busy indicator")
Accessible.description: qsTr("Displayed when the model is loading")
Accessible.description: qsTr("loading model...")
}

Label {
Expand Down Expand Up @@ -339,8 +339,8 @@ Window {
padding: 15

Accessible.role: Accessible.ButtonMenu
Accessible.name: qsTr("Hamburger button")
Accessible.description: qsTr("Hamburger button that reveals a drawer on the left of the application")
Accessible.name: qsTr("Main menu")
Accessible.description: qsTr("Navigation drawer with options")

background: Item {
anchors.centerIn: parent
Expand Down Expand Up @@ -389,7 +389,7 @@ Window {
Item {
Accessible.role: Accessible.Dialog
Accessible.name: qsTr("Network dialog")
Accessible.description: qsTr("Dialog for opt-in to sharing feedback/conversations")
Accessible.description: qsTr("opt-in to share feedback/conversations")
}
}

Expand All @@ -405,7 +405,7 @@ Window {
padding: 15
toggled: MySettings.networkIsActive
source: "qrc:/gpt4all/icons/network.svg"
Accessible.name: qsTr("Network button")
Accessible.name: qsTr("Network")
Accessible.description: qsTr("Reveals a dialogue where you can opt-in for sharing data over network")

onClicked: {
Expand Down Expand Up @@ -441,8 +441,8 @@ Window {
padding: 15
toggled: currentChat.collectionList.length
source: "qrc:/gpt4all/icons/db.svg"
Accessible.name: qsTr("Add collections of documents to the chat")
Accessible.description: qsTr("Provides a button to add collections of documents to the chat")
Accessible.name: qsTr("Add documents")
Accessible.description: qsTr("add collections of documents to the chat")

onClicked: {
collectionsDialog.open()
Expand All @@ -460,8 +460,8 @@ Window {
z: 200
padding: 15
source: "qrc:/gpt4all/icons/settings.svg"
Accessible.name: qsTr("Settings button")
Accessible.description: qsTr("Reveals a dialogue where you can change various settings")
Accessible.name: qsTr("Settings")
Accessible.description: qsTr("Reveals a dialogue with settings")

onClicked: {
settingsDialog.open()
Expand Down Expand Up @@ -528,7 +528,7 @@ Window {
z: 200
padding: 15
source: "qrc:/gpt4all/icons/copy.svg"
Accessible.name: qsTr("Copy button")
Accessible.name: qsTr("Copy")
Accessible.description: qsTr("Copy the conversation to the clipboard")

TextEdit{
Expand Down Expand Up @@ -595,7 +595,7 @@ Window {
source: "qrc:/gpt4all/icons/regenerate.svg"

Accessible.name: text
Accessible.description: qsTr("Reset the context which erases current conversation")
Accessible.description: qsTr("Reset the context and erase current conversation")

onClicked: {
Network.sendResetContext(chatModel.count)
Expand Down Expand Up @@ -623,7 +623,7 @@ Window {
font.pixelSize: theme.fontSizeLarge
Accessible.role: Accessible.Dialog
Accessible.name: text
Accessible.description: qsTr("Dialog indicating an error")
Accessible.description: qsTr("Error dialog")
}
background: Rectangle {
anchors.fill: parent
Expand All @@ -641,7 +641,7 @@ Window {
height: window.height - (window.height * .1)
Item {
Accessible.role: Accessible.Dialog
Accessible.name: qsTr("Download new models dialog")
Accessible.name: qsTr("Download new models")
Accessible.description: qsTr("Dialog for downloading new models")
}
}
Expand Down Expand Up @@ -740,8 +740,8 @@ Window {
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn }

Accessible.role: Accessible.List
Accessible.name: qsTr("List of prompt/response pairs")
Accessible.description: qsTr("This is the list of prompt/response pairs comprising the actual conversation with the model")
Accessible.name: qsTr("Conversation with the model")
Accessible.description: qsTr("prompt / response pairs from the conversation")

delegate: TextArea {
id: myTextArea
Expand Down Expand Up @@ -811,7 +811,7 @@ Window {
running: (currentResponse ? true : false) && value === "" && currentChat.responseInProgress
Accessible.role: Accessible.Animation
Accessible.name: qsTr("Busy indicator")
Accessible.description: qsTr("Displayed when the model is thinking")
Accessible.description: qsTr("The model is thinking")
}
Label {
anchors.verticalCenter: parent.verticalCenter
Expand Down Expand Up @@ -1053,7 +1053,7 @@ Window {
}
Accessible.role: Accessible.EditableText
Accessible.name: placeholderText
Accessible.description: qsTr("Textfield for sending messages/prompts to the model")
Accessible.description: qsTr("Send messages/prompts to the model")
Keys.onReturnPressed: (event)=> {
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier)
event.accepted = false;
Expand Down Expand Up @@ -1090,7 +1090,7 @@ Window {
height: 30
visible: !currentChat.isServer
source: "qrc:/gpt4all/icons/send_message.svg"
Accessible.name: qsTr("Send the message button")
Accessible.name: qsTr("Send message")
Accessible.description: qsTr("Sends the message/prompt contained in textfield to the model")

onClicked: {
Expand Down
18 changes: 9 additions & 9 deletions gpt4all-chat/qml/ApplicationSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ MySettingsTab {
Layout.fillWidth: false
model: ["Dark", "Light"]
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the color theme")
Accessible.description: qsTr("Use this for picking the color theme for the chat client to use")
Accessible.name: qsTr("Color theme")
Accessible.description: qsTr("Color theme for the chat client to use")
function updateModel() {
themeBox.currentIndex = themeBox.indexOfValue(MySettings.chatTheme);
}
Expand Down Expand Up @@ -70,8 +70,8 @@ MySettingsTab {
Layout.fillWidth: false
model: ["Small", "Medium", "Large"]
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the font size")
Accessible.description: qsTr("Use this for picking the font size of the chat client")
Accessible.name: qsTr("Font size")
Accessible.description: qsTr("Font size of the chat client")
function updateModel() {
fontBox.currentIndex = fontBox.indexOfValue(MySettings.fontSize);
}
Expand Down Expand Up @@ -105,8 +105,8 @@ MySettingsTab {
Layout.fillWidth: false
model: MySettings.deviceList
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the device")
Accessible.description: qsTr("Use this for picking the device of the chat client")
Accessible.name: qsTr("Device")
Accessible.description: qsTr("Device of the chat client")
function updateModel() {
deviceBox.currentIndex = deviceBox.indexOfValue(MySettings.device);
}
Expand Down Expand Up @@ -143,8 +143,8 @@ MySettingsTab {
Layout.fillWidth: true
model: ModelList.userDefaultModelList
Accessible.role: Accessible.ComboBox
Accessible.name: qsTr("ComboBox for displaying/picking the default model")
Accessible.description: qsTr("Use this for picking the default model to use; the first item is the current default model")
Accessible.name: qsTr("Default model")
Accessible.description: qsTr("Default model to use; the first item is the current default model")
function updateModel() {
comboBox.currentIndex = comboBox.indexOfValue(MySettings.userDefaultModel);
}
Expand Down Expand Up @@ -194,7 +194,7 @@ MySettingsTab {
Layout.row: 5
Layout.column: 2
text: qsTr("Browse")
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
Accessible.description: qsTr("Choose where to save model files")
onClicked: {
openFolderDialog("file://" + MySettings.modelPath, function(selectedFolder) {
MySettings.modelPath = selectedFolder
Expand Down
26 changes: 11 additions & 15 deletions gpt4all-chat/qml/ChatDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Drawer {
anchors.margins: 10

Accessible.role: Accessible.Pane
Accessible.name: qsTr("Drawer on the left of the application")
Accessible.description: qsTr("Drawer that is revealed by pressing the hamburger button")
Accessible.name: qsTr("Drawer")
Accessible.description: qsTr("Main navigation drawer")

MyButton {
id: newChat
Expand All @@ -42,7 +42,7 @@ Drawer {
topPadding: 20
bottomPadding: 20
text: qsTr("\uFF0B New chat")
Accessible.description: qsTr("Use this to create a new chat")
Accessible.description: qsTr("Create a new chat")
background: Rectangle {
border.color: newChat.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
Expand Down Expand Up @@ -135,7 +135,7 @@ Drawer {
}
Accessible.role: Accessible.Button
Accessible.name: qsTr("Select the current chat")
Accessible.description: qsTr("Provides a button to select the current chat or edit the chat when in edit mode")
Accessible.description: qsTr("Select the current chat or edit the chat when in edit mode")
}
Row {
id: buttons
Expand All @@ -155,8 +155,7 @@ Drawer {
chatName.readOnly = false
chatName.selectByMouse = true
}
Accessible.name: qsTr("Edit the chat name")
Accessible.description: qsTr("Provides a button to edit the chat name")
Accessible.name: qsTr("Edit chat name")
}
MyToolButton {
id: trashButton
Expand All @@ -168,8 +167,7 @@ Drawer {
trashQuestionDisplayed = true
timer.start()
}
Accessible.name: qsTr("Delete of the chat")
Accessible.description: qsTr("Provides a button to delete the chat")
Accessible.name: qsTr("Delete chat")
}
}
Rectangle {
Expand Down Expand Up @@ -207,8 +205,7 @@ Drawer {
Network.sendRemoveChat()
}
Accessible.role: Accessible.Button
Accessible.name: qsTr("Confirm delete of the chat")
Accessible.description: qsTr("Provides a button to confirm delete of the chat")
Accessible.name: qsTr("Confirm chat deletion")
}
Button {
id: cancel
Expand All @@ -230,8 +227,7 @@ Drawer {
trashQuestionDisplayed = false
}
Accessible.role: Accessible.Button
Accessible.name: qsTr("Cancel the delete of the chat")
Accessible.description: qsTr("Provides a button to cancel delete of the chat")
Accessible.name: qsTr("Cancel chat deletion")
}
}
}
Expand All @@ -256,7 +252,7 @@ Drawer {
anchors.bottomMargin: 10
text: qsTr("Updates")
font.pixelSize: theme.fontSizeLarge
Accessible.description: qsTr("Use this to launch an external application that will check for updates to the installer")
Accessible.description: qsTr("Launch an external application that will check for updates to the installer")
onClicked: {
if (!LLM.checkForUpdates())
checkForUpdatesError.open()
Expand All @@ -270,7 +266,7 @@ Drawer {
anchors.bottom: aboutButton.top
anchors.bottomMargin: 10
text: qsTr("Downloads")
Accessible.description: qsTr("Use this to launch a dialog to download new models")
Accessible.description: qsTr("Launch a dialog to download new models")
onClicked: {
downloadClicked()
}
Expand All @@ -282,7 +278,7 @@ Drawer {
anchors.right: parent.right
anchors.bottom: parent.bottom
text: qsTr("About")
Accessible.description: qsTr("Use this to launch a dialog to show the about page")
Accessible.description: qsTr("Launch a dialog to show the about page")
onClicked: {
aboutClicked()
}
Expand Down
2 changes: 1 addition & 1 deletion gpt4all-chat/qml/LocalDocsSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ MySettingsTab {
text: qsTr("Add")
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Add button")
Accessible.description: qsTr("Add collection")
onClicked: {
var isError = false;
if (root.collection === "") {
Expand Down
12 changes: 6 additions & 6 deletions gpt4all-chat/qml/ModelDownloaderDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ MyDialog {
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
visible: !isChatGPT && !installed && !calcHash && downloadError === ""
Accessible.description: qsTr("Cancel/Resume/Download button to stop/restart/start the download")
Accessible.description: qsTr("Stop/restart/start the download")
background: Rectangle {
border.color: downloadButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
Expand All @@ -151,7 +151,7 @@ MyDialog {
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
visible: installed || downloadError !== ""
Accessible.description: qsTr("Remove button to remove model from filesystem")
Accessible.description: qsTr("Remove model from filesystem")
background: Rectangle {
border.color: removeButton.down ? theme.backgroundLightest : theme.buttonBorder
border.width: 2
Expand Down Expand Up @@ -186,8 +186,8 @@ MyDialog {
Download.installModel(filename, openaiKey.text);
}
Accessible.role: Accessible.Button
Accessible.name: qsTr("Install button")
Accessible.description: qsTr("Install button to install chatgpt model")
Accessible.name: qsTr("Install")
Accessible.description: qsTr("Install chatGPT model")
}

ColumnLayout {
Expand Down Expand Up @@ -385,7 +385,7 @@ MyDialog {
linkColor: theme.textColor
Accessible.role: Accessible.Paragraph
Accessible.name: qsTr("Description")
Accessible.description: qsTr("The description of the file")
Accessible.description: qsTr("File description")
onLinkActivated: Qt.openUrlExternally(link)
}
}
Expand Down Expand Up @@ -456,7 +456,7 @@ MyDialog {
}
MyButton {
text: qsTr("Browse")
Accessible.description: qsTr("Opens a folder picker dialog to choose where to save model files")
Accessible.description: qsTr("Choose where to save model files")
onClicked: modelPathDialog.open()
}
}
Expand Down
2 changes: 1 addition & 1 deletion gpt4all-chat/qml/MySettingsTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Item {
font.pixelSize: theme.fontSizeLarge
Accessible.role: Accessible.Button
Accessible.name: text
Accessible.description: qsTr("Restores the settings dialog to a default state")
Accessible.description: qsTr("Restores settings dialog to a default state")
onClicked: {
root.restoreDefaultsClicked();
}
Expand Down
6 changes: 3 additions & 3 deletions gpt4all-chat/qml/NetworkDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
}
Accessible.role: Accessible.EditableText
Accessible.name: qsTr("Attribution (optional)")
Accessible.description: qsTr("Textfield for providing attribution")
Accessible.description: qsTr("Provide attribution")
onEditingFinished: {
MySettings.networkAttribution = attribution.text;
}
Expand All @@ -103,12 +103,12 @@ NOTE: By turning on this feature, you will be sending your data to the GPT4All O
spacing: 10
MyButton {
text: qsTr("Enable")
Accessible.description: qsTr("Enable opt-in button")
Accessible.description: qsTr("Enable opt-in")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
MyButton {
text: qsTr("Cancel")
Accessible.description: qsTr("Cancel opt-in button")
Accessible.description: qsTr("Cancel opt-in")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}
background: Rectangle {
Expand Down
4 changes: 2 additions & 2 deletions gpt4all-chat/qml/SettingsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ MyDialog {

Item {
Accessible.role: Accessible.Dialog
Accessible.name: qsTr("Settings dialog")
Accessible.description: qsTr("Dialog containing various application settings")
Accessible.name: qsTr("Settings")
Accessible.description: qsTr("Contains various application settings")
}

ListModel {
Expand Down
Loading

0 comments on commit 721d854

Please sign in to comment.