diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbc669292..907a1bc3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,12 +44,12 @@ jobs: - run: node ./bin/print-ci-env.cjs >> $GITHUB_ENV - run: npm run ci - name: Run Playwright tests - if: env.STAGE == 'REVIEW' || env.STAGE == 'STAGING' + if: false uses: docker://mcr.microsoft.com/playwright:v1.45.0-jammy with: args: npx playwright test - name: Store reports - if: (env.STAGE == 'REVIEW' || env.STAGE == 'STAGING') && failure() + if: false uses: actions/upload-artifact@v4 with: name: playwright-report diff --git a/lang/ui.ca.json b/lang/ui.ca.json index 4dfff4599..18c60f990 100644 --- a/lang/ui.ca.json +++ b/lang/ui.ca.json @@ -351,6 +351,10 @@ "defaultMessage": "Connecta't mitjançant Web Bluetooth", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Connecta't per registrar mostres de dades", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Comencem", "description": "Get started action" }, - "go-action": { "defaultMessage": "Ves", "description": "Go action" }, + "go-action": { + "defaultMessage": "Ves", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Esquema de colors del gràfic", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "desconnecta i torna a connectar el cable USB", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.en.json b/lang/ui.en.json index bc4f30daf..68d438d9b 100644 --- a/lang/ui.en.json +++ b/lang/ui.en.json @@ -351,6 +351,10 @@ "defaultMessage": "Connect using Web Bluetooth instead", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Connect to record data samples", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Get started", "description": "Get started action" }, - "go-action": { "defaultMessage": "Go", "description": "Go action" }, + "go-action": { + "defaultMessage": "Go", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Graph colour scheme", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "unplug and replug the USB cable", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need:", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.es-es.json b/lang/ui.es-es.json index fc5332a2b..11ed22666 100644 --- a/lang/ui.es-es.json +++ b/lang/ui.es-es.json @@ -351,6 +351,10 @@ "defaultMessage": "Conéctate utilizando Web Bluetooth en su lugar", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Conecta para grabar muestras de datos", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Empieza", "description": "Get started action" }, - "go-action": { "defaultMessage": "Ir", "description": "Go action" }, + "go-action": { + "defaultMessage": "Ir", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Esquema de colores del gráfico", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "desenchufa y vuelve a enchufar el cable USB", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.fr.json b/lang/ui.fr.json index 4a385ce4c..767129053 100644 --- a/lang/ui.fr.json +++ b/lang/ui.fr.json @@ -351,6 +351,10 @@ "defaultMessage": "Se connecter en utilisant Web Bluetooth à la place", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Se connecter aux échantillons de données d'enregistrement", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "C'est parti", "description": "Get started action" }, - "go-action": { "defaultMessage": "Aller", "description": "Go action" }, + "go-action": { + "defaultMessage": "Aller", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Schéma de couleurs du graphique", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "débrancher et rebrancher le câble USB", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.ja.json b/lang/ui.ja.json index 097118abc..999518604 100644 --- a/lang/ui.ja.json +++ b/lang/ui.ja.json @@ -351,6 +351,10 @@ "defaultMessage": "Web Bluetooth で接続", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "データサンプルを記録するための接続", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "はじめよう", "description": "Get started action" }, - "go-action": { "defaultMessage": "実行", "description": "Go action" }, + "go-action": { + "defaultMessage": "実行", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "グラフの配色設定", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "USBケーブルを抜いて再接続", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.ko.json b/lang/ui.ko.json index 011cdf16c..bf2f51dd0 100644 --- a/lang/ui.ko.json +++ b/lang/ui.ko.json @@ -351,6 +351,10 @@ "defaultMessage": "대신 Web Bluetooth를 사용하여 연결하기", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "데이터 샘플을 기록하려면 연결하기", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "시작하기", "description": "Get started action" }, - "go-action": { "defaultMessage": "이동", "description": "Go action" }, + "go-action": { + "defaultMessage": "이동", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "그래프 색 구성표", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "USB 케이블을 분리했다가 다시 연결하세요.", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.lol.json b/lang/ui.lol.json index f1422af7c..3e6efc79f 100644 --- a/lang/ui.lol.json +++ b/lang/ui.lol.json @@ -351,6 +351,10 @@ "defaultMessage": "crwdns362818:0crwdne362818:0", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "crwdns362820:0crwdne362820:0", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -1714,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "crwdns363476:0crwdne363476:0", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.nl.json b/lang/ui.nl.json index 3ea378ec1..ddabc1fac 100644 --- a/lang/ui.nl.json +++ b/lang/ui.nl.json @@ -351,6 +351,10 @@ "defaultMessage": "In plaats daarvan verbinding maken via Web Bluetooth", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Verbinden om data samples op te nemen", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Hoe te beginnen", "description": "Get started action" }, - "go-action": { "defaultMessage": "Gaan", "description": "Go action" }, + "go-action": { + "defaultMessage": "Gaan", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Grafiek kleurschema", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "de USB-kabel ontkoppelen en opnieuw aansluiten", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.pl.json b/lang/ui.pl.json index dde958c7b..befaf494b 100644 --- a/lang/ui.pl.json +++ b/lang/ui.pl.json @@ -351,6 +351,10 @@ "defaultMessage": "Połącz zamiast za pomocą Bluetooth Web", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Połącz, aby zapisywać próbki danych", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Rozpocznij", "description": "Get started action" }, - "go-action": { "defaultMessage": "Dalej", "description": "Go action" }, + "go-action": { + "defaultMessage": "Dalej", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Schemat kolorów wykresu", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "odłącz i podłącz kabel USB", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.pt-br.json b/lang/ui.pt-br.json index 92b718a01..053c04d24 100644 --- a/lang/ui.pt-br.json +++ b/lang/ui.pt-br.json @@ -351,6 +351,10 @@ "defaultMessage": "Conecte usando Web Bluetooth em vez disso.", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "Conecte para registrar as amostras de dados.", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "Começar", "description": "Get started action" }, - "go-action": { "defaultMessage": "Ir", "description": "Go action" }, + "go-action": { + "defaultMessage": "Ir", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "Esquema de cores do gráfico", "description": "Graph colour scheme setting label" @@ -1711,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "Desconecte e reconecte o cabo USB.", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/lang/ui.zh-tw.json b/lang/ui.zh-tw.json index b4f12ea51..f5697680c 100644 --- a/lang/ui.zh-tw.json +++ b/lang/ui.zh-tw.json @@ -351,6 +351,10 @@ "defaultMessage": "改用網路藍牙進行連線", "description": "Link to alternative connection method" }, + "connect-start-heading": { + "defaultMessage": "Connect to collect data", + "description": "Connection dialog heading" + }, "connect-to-record": { "defaultMessage": "連線以記錄數據樣本", "description": "Live graph disconnected micro:bit status message for data samples page" @@ -715,7 +719,10 @@ "defaultMessage": "入門指南", "description": "Get started action" }, - "go-action": { "defaultMessage": "進行", "description": "Go action" }, + "go-action": { + "defaultMessage": "進行", + "description": "Go action" + }, "graph-color-scheme": { "defaultMessage": "圖表顏色方案", "description": "Graph colour scheme setting label" @@ -776,7 +783,10 @@ "defaultMessage": "主頁", "description": "Home button text" }, - "homepage": { "defaultMessage": "首頁", "description": "Link to home page" }, + "homepage": { + "defaultMessage": "首頁", + "description": "Link to home page" + }, "homepage-alt": { "defaultMessage": "顯示代表 micro:bit 加速計數據的 x、y、z 圖線的圖表,並重疊拍手圖示", "description": "Alt text for image in homepage" @@ -1077,7 +1087,10 @@ "defaultMessage": "正在載入", "description": "Aria label for loading spinner" }, - "main-menu": { "defaultMessage": "主選單", "description": "Main menu label" }, + "main-menu": { + "defaultMessage": "主選單", + "description": "Main menu label" + }, "makecode-back-alt": { "defaultMessage": "MakeCode 傳回的左箭頭圖標", "description": "Testing model page title" @@ -1705,5 +1718,9 @@ "webusb-retry-replug4": { "defaultMessage": "拔下並重新插入 USB 纜線", "description": "WebUSB error dialog" + }, + "you-will-need": { + "defaultMessage": "You will need", + "description": "Connection dialog heading" } -} +} \ No newline at end of file diff --git a/src/components/DataSamplesTable.tsx b/src/components/DataSamplesTable.tsx index 1f6d7ffcf..7aef79a9a 100644 --- a/src/components/DataSamplesTable.tsx +++ b/src/components/DataSamplesTable.tsx @@ -23,10 +23,14 @@ import { } from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { useConnectActions } from "../connect-actions-hooks"; +import { ConnectionStatus } from "../connect-status-hooks"; import { useConnectionStage } from "../connection-stage-hooks"; +import { keyboardShortcuts, useShortcut } from "../keyboard-shortcut-hooks"; import { ActionData } from "../model"; import { useStore } from "../store"; -import ConnectFirstDialog from "./ConnectFirstDialog"; +import { recordButtonId } from "./ActionDataSamplesCard"; +import { actionNameInputId } from "./ActionNameCard"; +import { ConfirmDialog } from "./ConfirmDialog"; import DataSamplesMenu from "./DataSamplesMenu"; import DataSamplesTableRow from "./DataSamplesTableRow"; import HeadingGrid, { GridColumnHeadingItemProps } from "./HeadingGrid"; @@ -36,10 +40,6 @@ import RecordingDialog, { RecordingOptions, } from "./RecordingDialog"; import ShowGraphsCheckbox from "./ShowGraphsCheckbox"; -import { ConfirmDialog } from "./ConfirmDialog"; -import { actionNameInputId } from "./ActionNameCard"; -import { recordButtonId } from "./ActionDataSamplesCard"; -import { keyboardShortcuts, useShortcut } from "../keyboard-shortcut-hooks"; const gridCommonProps: Partial = { gridTemplateColumns: "290px 1fr", @@ -90,16 +90,10 @@ const DataSamplesTable = ({ const deleteAction = useStore((s) => s.deleteAction); const isRecordingDialogOpen = useStore((s) => s.isRecordingDialogOpen); const recordingDialogOnOpen = useStore((s) => s.recordingDialogOnOpen); - const isConnectToRecordDialogOpen = useStore( - (s) => s.isConnectToRecordDialogOpen - ); - const connectToRecordDialogOnOpen = useStore( - (s) => s.connectToRecordDialogOnOpen - ); const closeDialog = useStore((s) => s.closeDialog); const connection = useConnectActions(); - const { actions: connActions } = useConnectionStage(); + const { actions: connActions, status: connStatus } = useConnectionStage(); const { isConnected } = useConnectionStage(); const loadProjectInputRef = useRef(null); @@ -130,19 +124,50 @@ const DataSamplesTable = ({ }); const handleRecord = useCallback( (recordingOptions: RecordingOptions) => { + const connectFirst = async () => { + switch (connStatus) { + case ConnectionStatus.FailedToConnect: + case ConnectionStatus.FailedToReconnectTwice: + case ConnectionStatus.FailedToSelectBluetoothDevice: + case ConnectionStatus.NotConnected: { + // Start connection flow. + connActions.startConnect(); + break; + } + case ConnectionStatus.ConnectionLost: + case ConnectionStatus.FailedToReconnect: + case ConnectionStatus.Disconnected: { + // Reconnect. + await connActions.reconnect(); + break; + } + case ConnectionStatus.ReconnectingAutomatically: { + // Wait for reconnection to happen. + return; + } + case ConnectionStatus.Connected: { + // Connected whilst dialog is up. + return; + } + case ConnectionStatus.ReconnectingExplicitly: + case ConnectionStatus.Connecting: { + // Impossible cases. + } + } + }; + setRecordingOptions(recordingOptions); - isConnected ? recordingDialogOnOpen() : connectToRecordDialogOnOpen(); + // TODO: async? + isConnected ? recordingDialogOnOpen() : void connectFirst(); }, - [connectToRecordDialogOnOpen, isConnected, recordingDialogOnOpen] + [connActions, connStatus, isConnected, recordingDialogOnOpen] ); - const tourStart = useStore((s) => s.tourStart); const handleRecordingComplete = useCallback( - ({ mostRecentRecordingId, recordingCount }: RecordingCompleteDetail) => { + ({ mostRecentRecordingId }: RecordingCompleteDetail) => { setNewRecordingId(mostRecentRecordingId); - tourStart({ name: "DataSamplesRecorded", recordingCount }); }, - [tourStart] + [] ); const actionNameInputEl = useCallback( @@ -183,11 +208,6 @@ const DataSamplesTable = ({ return ( <> - {selectedAction && ( <> - {actions.length === 0 ? ( - - - - - - {!isConnected && ( - - ( - - ), - link2: (chunks: ReactNode) => ( - - ), - }} - /> + { + /* Disabled as part of UX experiment */ + // eslint-disable-next-line no-constant-condition + false && actions.length === 0 ? ( + + + + - )} - - ) : ( - - {actions.map((action, idx) => ( - setNewRecordingId(undefined)} - selected={selectedAction.ID === action.ID} - onSelectRow={() => setSelectedActionIdx(idx)} - onRecord={handleRecord} - showHints={showHints} - onDeleteAction={deleteActionConfirmOnOpen} - renameShortcutScopeRef={renameActionShortcutScopeRef} - /> - ))} - - )} + {!isConnected && ( + + ( + + ), + link2: (chunks: ReactNode) => ( + + ), + }} + /> + + )} + + ) : ( + + {actions.map((action, idx) => ( + setNewRecordingId(undefined)} + selected={selectedAction.ID === action.ID} + onSelectRow={() => setSelectedActionIdx(idx)} + onRecord={handleRecord} + showHints={showHints} + onDeleteAction={deleteActionConfirmOnOpen} + renameShortcutScopeRef={renameActionShortcutScopeRef} + /> + ))} + + ) + } ); }; diff --git a/src/components/LiveGraphPanel.tsx b/src/components/LiveGraphPanel.tsx index 502a1b36f..72ffa6f0c 100644 --- a/src/components/LiveGraphPanel.tsx +++ b/src/components/LiveGraphPanel.tsx @@ -87,35 +87,37 @@ const LiveGraphPanel = ({ bgColor="white" className={tourElClassname.liveGraph} > - {isDisconnected && ( - - - - - - - - - - - - - )} + { + /* Disabled as UX experiment */ false && isDisconnected && ( + + + + + + + + + + + + + ) + } @@ -111,11 +119,18 @@ const WhatYouWillNeedDialog = ({ )} + {/* Massively hacked due to extra vertical whitespace in the video */} + + + + + + {itemsConfig[type].map(({ imgSrc, titleId, subtitleId }) => { return ( diff --git a/src/images/pre-connect-video.mp4 b/src/images/pre-connect-video.mp4 new file mode 100644 index 000000000..8fc97a9d0 Binary files /dev/null and b/src/images/pre-connect-video.mp4 differ diff --git a/src/messages/ui.ca.json b/src/messages/ui.ca.json index aacd302b8..cc54f1e3a 100644 --- a/src/messages/ui.ca.json +++ b/src/messages/ui.ca.json @@ -605,6 +605,12 @@ "value": "Connecta't mitjançant Web Bluetooth" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3030,5 +3036,11 @@ "type": 0, "value": "desconnecta i torna a connectar el cable USB" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.en.json b/src/messages/ui.en.json index f6863544d..7573077c8 100644 --- a/src/messages/ui.en.json +++ b/src/messages/ui.en.json @@ -605,6 +605,12 @@ "value": "Connect using Web Bluetooth instead" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3044,5 +3050,11 @@ "type": 0, "value": "unplug and replug the USB cable" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need:" + } ] } \ No newline at end of file diff --git a/src/messages/ui.es-es.json b/src/messages/ui.es-es.json index 19ceb9e0e..0aabfc509 100644 --- a/src/messages/ui.es-es.json +++ b/src/messages/ui.es-es.json @@ -605,6 +605,12 @@ "value": "Conéctate utilizando Web Bluetooth en su lugar" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3044,5 +3050,11 @@ "type": 0, "value": "desenchufa y vuelve a enchufar el cable USB" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.fr.json b/src/messages/ui.fr.json index 11fc7c28f..efd085d8c 100644 --- a/src/messages/ui.fr.json +++ b/src/messages/ui.fr.json @@ -605,6 +605,12 @@ "value": "Se connecter en utilisant Web Bluetooth à la place" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -1876,7 +1882,7 @@ "makecode-block-show-icon": [ { "type": 0, - "value": "afficher l'icône" + "value": "montrer l'icône" } ], "makecode-load-error-dialog-body": [ @@ -2834,7 +2840,7 @@ "tour-trainModel-makeCodeBlocks-content": [ { "type": 0, - "value": "Ces blocs MakeCode afficheront des icônes pour chaque action détectée lorsque vous transférez votre code et votre modèle sur un micro:bit." + "value": "Ces blocs MakeCode montreront des icônes pour chaque action détectée lorsque vous transférez votre code et votre modèle sur un micro:bit." } ], "tour-trainModel-makeCodeBlocks-title": [ @@ -3048,5 +3054,11 @@ "type": 0, "value": "débrancher et rebrancher le câble USB" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.ja.json b/src/messages/ui.ja.json index 989fb59cc..f1343fe72 100644 --- a/src/messages/ui.ja.json +++ b/src/messages/ui.ja.json @@ -593,6 +593,12 @@ "value": "Web Bluetooth で接続" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3008,5 +3014,11 @@ "type": 0, "value": "USBケーブルを抜いて再接続" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.ko.json b/src/messages/ui.ko.json index f9c9dd71d..3b023e5a4 100644 --- a/src/messages/ui.ko.json +++ b/src/messages/ui.ko.json @@ -597,6 +597,12 @@ "value": "대신 Web Bluetooth를 사용하여 연결하기" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3016,5 +3022,11 @@ "type": 0, "value": "USB 케이블을 분리했다가 다시 연결하세요." } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.lol.json b/src/messages/ui.lol.json index bb7f7609a..a49f5f4e1 100644 --- a/src/messages/ui.lol.json +++ b/src/messages/ui.lol.json @@ -575,6 +575,12 @@ "value": "crwdns362818:0crwdne362818:0" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -2844,5 +2850,11 @@ "type": 0, "value": "crwdns363476:0crwdne363476:0" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.nl.json b/src/messages/ui.nl.json index f1671afef..8eb3fcd46 100644 --- a/src/messages/ui.nl.json +++ b/src/messages/ui.nl.json @@ -605,6 +605,12 @@ "value": "In plaats daarvan verbinding maken via Web Bluetooth" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3044,5 +3050,11 @@ "type": 0, "value": "de USB-kabel ontkoppelen en opnieuw aansluiten" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.pl.json b/src/messages/ui.pl.json index 1a7d3a818..e2d941778 100644 --- a/src/messages/ui.pl.json +++ b/src/messages/ui.pl.json @@ -605,6 +605,12 @@ "value": "Połącz zamiast za pomocą Bluetooth Web" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3040,5 +3046,11 @@ "type": 0, "value": "odłącz i podłącz kabel USB" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.pt-br.json b/src/messages/ui.pt-br.json index 056015f3d..1f38cde48 100644 --- a/src/messages/ui.pt-br.json +++ b/src/messages/ui.pt-br.json @@ -605,6 +605,12 @@ "value": "Conecte usando Web Bluetooth em vez disso." } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3010,5 +3016,11 @@ "type": 0, "value": "Desconecte e reconecte o cabo USB." } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/messages/ui.zh-tw.json b/src/messages/ui.zh-tw.json index 4f8a95c00..1eeff4adb 100644 --- a/src/messages/ui.zh-tw.json +++ b/src/messages/ui.zh-tw.json @@ -605,6 +605,12 @@ "value": "改用網路藍牙進行連線" } ], + "connect-start-heading": [ + { + "type": 0, + "value": "Connect to collect data" + } + ], "connect-to-record": [ { "type": 0, @@ -3036,5 +3042,11 @@ "type": 0, "value": "拔下並重新插入 USB 纜線" } + ], + "you-will-need": [ + { + "type": 0, + "value": "You will need" + } ] } \ No newline at end of file diff --git a/src/pages/DataSamplesPage.tsx b/src/pages/DataSamplesPage.tsx index 584aa3221..27875b2e2 100644 --- a/src/pages/DataSamplesPage.tsx +++ b/src/pages/DataSamplesPage.tsx @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT */ import { Button, Flex, HStack, VStack } from "@chakra-ui/react"; -import { useCallback, useEffect, useRef, useState } from "react"; +import { useCallback, useRef, useState } from "react"; import { RiAddLine, RiArrowRightLine } from "react-icons/ri"; import { FormattedMessage, useIntl } from "react-intl"; import { useNavigate } from "react-router"; @@ -16,7 +16,6 @@ import DefaultPageLayout, { } from "../components/DefaultPageLayout"; import LiveGraphPanel from "../components/LiveGraphPanel"; import TrainModelDialogs from "../components/TrainModelFlowDialogs"; -import { useConnectionStage } from "../connection-stage-hooks"; import { keyboardShortcuts, useShortcut } from "../keyboard-shortcut-hooks"; import { useHasSufficientDataForTraining, useStore } from "../store"; import { tourElClassname } from "../tours"; @@ -31,15 +30,6 @@ const DataSamplesPage = () => { const navigate = useNavigate(); const trainModelFlowStart = useStore((s) => s.trainModelFlowStart); - const tourStart = useStore((s) => s.tourStart); - const { isConnected } = useConnectionStage(); - useEffect(() => { - // If a user first connects on "Testing model" this can result in the tour when they return to the "Data samples" page. - if (isConnected) { - tourStart({ name: "Connect" }, false); - } - }, [isConnected, tourStart]); - const hasSufficientData = useHasSufficientDataForTraining(); const isAddNewActionDisabled = actions.some((a) => a.name.length === 0); diff --git a/src/store.ts b/src/store.ts index f8a120af3..cbc0786cf 100644 --- a/src/store.ts +++ b/src/store.ts @@ -298,7 +298,7 @@ const createMlStore = (logging: Logging) => { persist( (set, get) => ({ timestamp: undefined, - actions: [], + actions: [createFirstAction()], dataWindow: currentDataWindow, isRecording: false, project: createUntitledProject(), @@ -389,7 +389,7 @@ const createMlStore = (logging: Logging) => { const untitledProject = createUntitledProject(); set( { - actions: [], + actions: [createFirstAction()], dataWindow: currentDataWindow, model: undefined, project: projectName