Skip to content

Commit

Permalink
feat(clients): add information about anonymous data tracking. (#704)
Browse files Browse the repository at this point in the history
* feat(clients): add information about anonymous data tracking.

* fix: update docs for anonymous usage data.

* Update website/docs/extensions/configurations.md

Co-authored-by: Meng Zhang <[email protected]>

* Update website/docs/extensions/configurations.md

Co-authored-by: Meng Zhang <[email protected]>

---------

Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
icycodes and wsxiaoys authored Nov 6, 2023
1 parent 039b8bf commit 424626c
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 14 deletions.
2 changes: 1 addition & 1 deletion clients/intellij/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "com.tabbyml"
version = "1.0.0"
version = "1.1.0-dev"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
package com.tabbyml.intellijtabby.settings

import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.components.JBLabel
import com.intellij.ui.components.JBRadioButton
import com.intellij.ui.components.JBTextField
import com.intellij.util.ui.FormBuilder
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.UIUtil
import javax.swing.ButtonGroup
import javax.swing.JPanel

private fun FormBuilder.addCopyableTooltip(text: String): FormBuilder {
return this.addComponentToRightColumn(
JBLabel(
text,
UIUtil.ComponentStyle.SMALL,
UIUtil.FontColor.BRIGHTER
).apply {
setBorder(JBUI.Borders.emptyLeft(10))
setCopyable(true)
},
1,
)
}

class ApplicationSettingsPanel {
private val serverEndpointTextField = JBTextField()
private val serverEndpointPanel = FormBuilder.createFormBuilder()
.addComponent(serverEndpointTextField)
.addTooltip(
.addCopyableTooltip(
"""
<html>
A http or https URL of Tabby server endpoint.<br/>
Expand All @@ -25,7 +42,7 @@ class ApplicationSettingsPanel {
private val nodeBinaryTextField = JBTextField()
private val nodeBinaryPanel = FormBuilder.createFormBuilder()
.addComponent(nodeBinaryTextField)
.addTooltip(
.addCopyableTooltip(
"""
<html>
Path to the Node binary for running the Tabby agent. The Node version must be >= 18.0.<br/>
Expand All @@ -43,12 +60,24 @@ class ApplicationSettingsPanel {
}
private val completionTriggerModePanel: JPanel = FormBuilder.createFormBuilder()
.addComponent(completionTriggerModeAutomaticRadioButton)
.addTooltip("Trigger automatically when you stop typing")
.addCopyableTooltip("Trigger automatically when you stop typing")
.addComponent(completionTriggerModeManualRadioButton)
.addTooltip("Trigger manually by pressing `Alt + \\`")
.addCopyableTooltip("Trigger manually by pressing `Alt + \\`")
.panel

private val isAnonymousUsageTrackingDisabledCheckBox = JBCheckBox("Disable")
private val isAnonymousUsageTrackingDisabledCheckBox = JBCheckBox("Disable anonymous usage tracking")
private val isAnonymousUsageTrackingPanel: JPanel = FormBuilder.createFormBuilder()
.addComponent(isAnonymousUsageTrackingDisabledCheckBox)
.addCopyableTooltip(
"""
<html>
Tabby collects aggregated anonymous usage data and sends it to the Tabby team to help improve our products.<br/>
Your code, generated completions, or any identifying information is never tracked or transmitted.<br/>
For more details on data collection, please check our <a href="https://tabby.tabbyml.com/docs/extensions/configuration#usage-collection">online documentation</a>.<br/>
</html>
"""
)
.panel

val mainPanel: JPanel = FormBuilder.createFormBuilder()
.addLabeledComponent("Server endpoint", serverEndpointPanel, 5, false)
Expand All @@ -57,7 +86,7 @@ class ApplicationSettingsPanel {
.addSeparator(5)
.addLabeledComponent("<html>Node binary<br/>(Requires restart IDE)</html>", nodeBinaryPanel, 5, false)
.addSeparator(5)
.addLabeledComponent("Anonymous usage tracking", isAnonymousUsageTrackingDisabledCheckBox, 5, false)
.addLabeledComponent("Anonymous usage tracking", isAnonymousUsageTrackingPanel, 5, false)
.addComponentFillVertically(JPanel(), 0)
.panel

Expand Down
14 changes: 9 additions & 5 deletions clients/tabby-agent/src/AgentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,31 @@ export const defaultAgentConfig: AgentConfig = {

const configTomlTemplate = `## Tabby agent configuration file
## You can uncomment any block to enable settings.
## Configurations in this file has lower priority than in IDE settings.
## Online documentation: https://tabby.tabbyml.com/docs/extensions/configuration
## You can uncomment and edit the values below to change the default settings.
## Configurations in this file have lower priority than the IDE settings.
## Server
## You can set the server endpoint here, and auth token if server requires.
## You can set the server endpoint here and an optional authentication token if required.
# [server]
# endpoint = "http://localhost:8080" # http or https URL
# token = "your-token-here" # if token is set, request header Authorization = "Bearer $token" will be added automatically
## You can add custom request headers.
# [server.requestHeaders]
# Header1 = "Value1" # list your custom headers here
# Header2 = "Value2" # value can be string, number or boolean
# Header2 = "Value2" # values can be strings, numbers or booleans
## Logs
## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
# [logs]
# level = "silent" # "silent" or "error" or "debug"
## Anonymous usage tracking
## You can disable anonymous usage tracking here.
## Tabby collects anonymous usage data and sends it to the Tabby team to help improve our products.
## Your code, generated completions, or any sensitive information is never tracked or sent.
## For more details on data collection, see https://tabby.tabbyml.com/docs/extensions/configuration#usage-collection
## Your contribution is greatly appreciated. However, if you prefer not to participate, you can disable anonymous usage tracking here.
# [anonymousUsageTracking]
# disable = false # set to true to disable
Expand Down
2 changes: 1 addition & 1 deletion clients/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"tabby.usage.anonymousUsageTracking": {
"type": "boolean",
"default": false,
"description": "Disable anonymous usage tracking."
"markdownDescription": "**Disable anonymous usage tracking** \nTabby collects aggregated anonymous usage data and sends it to the Tabby team to help improve our products. \nYour code, generated completions, or any identifying information is never tracked or transmitted. \nFor more details on data collection, please check our [online documentation](https://tabby.tabbyml.com/docs/extensions/configuration#usage-collection)."
}
}
},
Expand Down
66 changes: 66 additions & 0 deletions website/docs/extensions/configurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
sidebar_position: 98
---

# Configurations

This document describes the available configurations for Tabby IDE extensions.

## Config File

The Tabby agent, which is the core component of Tabby IDE extensions, reads configurations from the `~/.tabby-client/agent/config.toml` file. This file is automatically created when you first run the Tabby IDE extensions. You can edit this file to modify the configurations. The Tabby IDE extensions will automatically reload the config file when it detects changes.

:::tip
- Configurations set via the IDE settings page take precedence over the config file. If you want to use a configuration from the config file, make sure that the IDE setting is empty.
- If you are using the Tabby VSCode extension in a web browser, this config file is not available. You can use the VSCode settings page to configure the extension.
:::

## Server

The `server` section contains configurations related to the Tabby server.

```toml
# Server
# You can set the server endpoint here and an optional authentication token if required.
[server]
endpoint = "http://localhost:8080" # http or https URL
token = "your-token-here" # if token is set, request header Authorization = "Bearer $token" will be added automatically

# You can add custom request headers.
[server.requestHeaders]
Header1 = "Value1" # list your custom headers here
Header2 = "Value2" # values can be strings, numbers or booleans
```

## Logs

If you encounter any issues with the Tabby IDE extensions and need to report a bug, you can enable debug logs to help us investigate the issue.

```toml
# Logs
# You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/.
[logs]
level = "silent" # "silent" or "error" or "debug"
```

## Usage Collection

Tabby IDE extensions collect aggregated anonymous usage data and sends it to the Tabby team to help improve our products.

**Do not worry, your code, generated completions, or any identifying information is never tracked or transmitted.**

The data we collect, as of the latest update on November 6, 2023, contains following major parts:

- System info and extension version info
- Completions statistics
- Completion count
- Completion accepted count
- Completion HTTP request latency

We sincerely appreciate your contribution in sending anonymous usage data. However, if you prefer not to participate, you can disable anonymous usage tracking here:

```toml
# Anonymous usage tracking
[anonymousUsageTracking]
disable = false # set to true to disable
```
4 changes: 3 additions & 1 deletion website/docs/extensions/intellij.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ sidebar_position: 1


# IntelliJ Platform
#

IDEA, PyCharm, GoLand, Android Studio, and more

import IntelliJ from "../../../clients/intellij/README.md";

<IntelliJ />

0 comments on commit 424626c

Please sign in to comment.