This repository was archived by the owner on May 20, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Adds initial support for the x3 device #25
Merged
znelson
merged 8 commits into
crosspoint-reader:master
from
itsthisjustin:feature/x3-support
May 16, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
221037e
Adds initial support for the x3 device
itsthisjustin 625f7b4
Add X3 device model support to stock firmware fetcher
itsthisjustin 5bd31ad
Replace straight quotes with curly quotes in UI text
itsthisjustin 5632b10
Fix race condition in firmware version fetching
itsthisjustin a7f3716
Add X3 English firmware check endpoint
itsthisjustin ea39cb3
Standardize firmware update API endpoints
itsthisjustin caeb6fd
Add device model to firmware flash button label
itsthisjustin 826cdcd
Fix lint errors: unused imports, interface vs type, and prettier form…
znelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ import { | |
| Alert, | ||
| Stack, | ||
| Flex, | ||
| HStack, | ||
| } from '@chakra-ui/react'; | ||
| import FileUpload, { FileUploadHandle } from '@/components/FileUpload'; | ||
| import Steps from '@/components/Steps'; | ||
|
|
@@ -20,7 +21,8 @@ import { | |
| } from '@/remote/firmwareFetcher'; | ||
|
|
||
| export default function Home() { | ||
| const { actions, stepData, isRunning } = useEspOperations(); | ||
| const { actions, stepData, isRunning, deviceModel, setDeviceModel } = | ||
| useEspOperations(); | ||
| const [officialFirmwareVersions, setOfficialFirmwareVersions] = useState<{ | ||
| en: string; | ||
| ch: string; | ||
|
|
@@ -32,15 +34,42 @@ export default function Home() { | |
| const appPartitionFileInput = useRef<FileUploadHandle>(null); | ||
|
|
||
| useEffect(() => { | ||
| getOfficialFirmwareVersions().then((versions) => | ||
| setOfficialFirmwareVersions(versions), | ||
| ); | ||
| let cancelled = false; | ||
| setOfficialFirmwareVersions(null); | ||
| getOfficialFirmwareVersions(deviceModel).then((versions) => { | ||
| if (!cancelled) { | ||
| setOfficialFirmwareVersions(versions); | ||
| } | ||
| }); | ||
|
|
||
| return () => { | ||
| cancelled = true; | ||
| }; | ||
| }, [deviceModel]); | ||
|
|
||
| useEffect(() => { | ||
| getCommunityFirmwareRemoteData().then(setCommunityFirmwareVersions); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <Flex direction="column" gap="20px"> | ||
| <Stack gap={3} as="section"> | ||
| <Heading size="xl">Device model</Heading> | ||
| <HStack gap={3}> | ||
| {(['x4', 'x3'] as const).map((model) => ( | ||
| <Button | ||
| key={model} | ||
| variant={deviceModel === model ? 'solid' : 'outline'} | ||
| aria-pressed={deviceModel === model} | ||
| onClick={() => setDeviceModel(model)} | ||
| disabled={isRunning} | ||
| > | ||
| Xteink {model.toUpperCase()} | ||
| </Button> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| ))} | ||
| </HStack> | ||
| </Stack> | ||
|
Comment on lines
+56
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't expose the CrossPoint flash path in X3 mode yet. This selector makes X3 look fully supported, but the community firmware path is still model-agnostic in 🧭 Minimal UI guard <Button
variant="subtle"
onClick={actions.flashCrossPointFirmware}
- disabled={isRunning || !communityFirmwareVersions}
+ disabled={
+ isRunning || !communityFirmwareVersions || deviceModel === 'x3'
+ }
loading={!communityFirmwareVersions}
>🤖 Prompt for AI Agents |
||
| <Separator /> | ||
| <Alert.Root status="warning"> | ||
| <Alert.Indicator /> | ||
| <Alert.Content> | ||
|
|
@@ -136,23 +165,25 @@ export default function Home() { | |
| disabled={isRunning || !officialFirmwareVersions} | ||
| loading={!officialFirmwareVersions} | ||
| > | ||
| Flash English firmware ({officialFirmwareVersions?.en ?? '...'}) | ||
| Flash English firmware for {deviceModel.toUpperCase()} ( | ||
| {officialFirmwareVersions?.en ?? '...'}) | ||
| </Button> | ||
| <Button | ||
| variant="subtle" | ||
| onClick={actions.flashChineseFirmware} | ||
| disabled={isRunning || !officialFirmwareVersions} | ||
| loading={!officialFirmwareVersions} | ||
| > | ||
| Flash Chinese firmware ({officialFirmwareVersions?.ch ?? '...'}) | ||
| Flash Chinese firmware for {deviceModel.toUpperCase()} ( | ||
| {officialFirmwareVersions?.ch ?? '...'}) | ||
| </Button> | ||
| <Button | ||
| variant="subtle" | ||
| onClick={actions.flashCrossPointFirmware} | ||
| disabled={isRunning || !communityFirmwareVersions} | ||
| loading={!communityFirmwareVersions} | ||
| > | ||
| Flash CrossPoint firmware ( | ||
| Flash CrossPoint firmware for {deviceModel.toUpperCase()} ( | ||
| {communityFirmwareVersions?.crossPoint.version}) -{' '} | ||
| {communityFirmwareVersions?.crossPoint.releaseDate} | ||
| </Button> | ||
|
|
@@ -170,7 +201,7 @@ export default function Home() { | |
| } | ||
| disabled={isRunning} | ||
| > | ||
| Flash firmware from file | ||
| Flash firmware from file for {deviceModel.toUpperCase()} | ||
| </Button> | ||
| </Stack> | ||
| {process.env.NODE_ENV === 'development' && ( | ||
|
|
@@ -208,10 +239,10 @@ export default function Home() { | |
| <Alert.Title>Change device language</Alert.Title> | ||
| <Alert.Description> | ||
| Before starting the process, it is recommended to change the device | ||
| language to English. To do this, select “Settings” icon, then click | ||
| “OK / Confirm” button and “OK / Confirm” again until English is | ||
| shown. Otherwise, the language will still be Chinese after flashing | ||
| and you may not notice changes. | ||
| language to English. To do this, select “Settings” icon, | ||
| then click “OK / Confirm” button and “OK / | ||
| Confirm” again until English is shown. Otherwise, the language | ||
| will still be Chinese after flashing and you may not notice changes. | ||
| </Alert.Description> | ||
| </Alert.Content> | ||
| </Alert.Root> | ||
|
|
@@ -220,10 +251,21 @@ export default function Home() { | |
| <Alert.Content> | ||
| <Alert.Title>Device restart instructions</Alert.Title> | ||
| <Alert.Description> | ||
| Once you complete a write operation, you will need to restart your | ||
| device by pressing and releasing the small “Reset” button near the | ||
| bottom right, followed quickly by pressing and holding of the main | ||
| power button for about 3 seconds. | ||
| <Stack> | ||
| <p> | ||
| Once you complete a write operation, you will need to restart | ||
| your device by pressing and releasing the small | ||
| “Reset” button near the bottom right, followed | ||
| quickly by pressing and holding of the main power button for | ||
| about 3 seconds. | ||
| </p> | ||
| {deviceModel === 'x3' && ( | ||
| <p> | ||
| For CrossPoint firmware, disconnect the USB cable and connect | ||
| it again instead. | ||
| </p> | ||
| )} | ||
| </Stack> | ||
| </Alert.Description> | ||
| </Alert.Content> | ||
| </Alert.Root> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.