Skip to content

chore: Allow multiple environment logins, new desktop authentication storage, pool configuration, swap environment support. #7714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 151 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
e224766
fix: logging information about the login
nadr0 Jul 2, 2025
8f2a239
chore: improving the withBaseURL workflow
nadr0 Jul 2, 2025
fb8acbe
chore: moving VITE_KC_API_BASE_URL to the helper function
nadr0 Jul 2, 2025
7993b5f
fix: env to helper function api base url
nadr0 Jul 2, 2025
195000b
chore: fixing another api base url
nadr0 Jul 2, 2025
529c619
chore: shortlinks with base api helper function
nadr0 Jul 2, 2025
74f6e33
chore: prompt edit with base helper function
nadr0 Jul 2, 2025
eba91e8
fix: auto fmt
nadr0 Jul 2, 2025
d3aa09a
fix: withAPIBaseURL for all urls
nadr0 Jul 2, 2025
23e6094
fix: AI caught my typo, RIP
nadr0 Jul 2, 2025
aa460d6
fix: expected
nadr0 Jul 2, 2025
01d294a
chore: helper function and unit tests for a withSiteBaseURL
nadr0 Jul 2, 2025
e5d1cd8
chore: migrating many urls to the helper function withSiteBaseURL
nadr0 Jul 2, 2025
14a7234
chore: updated all VITE_KC_SITE_BASE_URL locations, need to do raw ur…
nadr0 Jul 2, 2025
693fd8e
fix: updating the signin page hard coded urls
nadr0 Jul 2, 2025
8dc1b15
chore: updated hard coded site urls in home.tsx
nadr0 Jul 2, 2025
bab98ab
chore: updated all site base urls
nadr0 Jul 2, 2025
3929f2e
chore: unit tests
nadr0 Jul 2, 2025
b97bcde
chore: using the websocket url instead of the hard coded environment …
nadr0 Jul 2, 2025
e7559c1
chore: urls are using the global websocket url
nadr0 Jul 2, 2025
9a5bcb3
fix: merged main
nadr0 Jul 7, 2025
dc75b72
fix: ope, this should be deleted
nadr0 Jul 7, 2025
d0be5c1
fix: huh?
nadr0 Jul 7, 2025
e1dfa80
chore: skeleton to get some environments going
nadr0 Jul 7, 2025
9aec7e4
chore: skeleton for ugly banner and chip, testing code
nadr0 Jul 7, 2025
d173fc5
chore: more skeleton code
nadr0 Jul 7, 2025
7d87ba1
fix: auto fixes
nadr0 Jul 8, 2025
ed32985
fix: unit tests to make sure these values do not acciendentally change
nadr0 Jul 8, 2025
05afda5
fix: auto fmt
nadr0 Jul 8, 2025
37af15d
fix: removing this for now, not ready
nadr0 Jul 8, 2025
bc717e4
fix: removing debugging comment
nadr0 Jul 8, 2025
c559969
chore: trying to figure out how to get the custom url and pool, most …
nadr0 Jul 8, 2025
33fb889
fix: auto fmt
nadr0 Jul 8, 2025
3533143
Merge branch 'main' into nadro/adhoc/environment-based-login
nadr0 Jul 8, 2025
c032988
fix: merged main
nadr0 Jul 9, 2025
25d53f5
Merge branch 'main' into nadro/adhoc/environment-based-login
nadr0 Jul 9, 2025
4e88300
fix: some clean up
nadr0 Jul 9, 2025
84d441a
chore: adding a status bar global
nadr0 Jul 9, 2025
6cd59b4
fix: auto fmt
nadr0 Jul 9, 2025
57da5f9
fix: changing font color
nadr0 Jul 9, 2025
1290e8f
fix: auto fmt
nadr0 Jul 9, 2025
293ddba
chore: trying to clean up the sign in page for multiple environments …
nadr0 Jul 9, 2025
cce275f
fix: linter, TS clean up
nadr0 Jul 9, 2025
55ebb74
fix: fmt
nadr0 Jul 10, 2025
3d509eb
fix: auto fixes
nadr0 Jul 10, 2025
ff851ba
fix: auto fixes and testing each environment and scenario
nadr0 Jul 10, 2025
726e4be
fix: default value fix with empty string
nadr0 Jul 10, 2025
abf7979
fix: removing console logs
nadr0 Jul 10, 2025
511a3a9
chore: adding where the envs are coming from
nadr0 Jul 10, 2025
1c2f20a
fix: adding comment gotcha
nadr0 Jul 10, 2025
26e1092
fix: swap environment command
nadr0 Jul 10, 2025
8a7203d
fix: autofmt
nadr0 Jul 11, 2025
3e27110
fix: adding unit tests
nadr0 Jul 11, 2025
dce24d1
fix: rename in unit test
nadr0 Jul 11, 2025
36987ce
chore: writing unit tests for deskopt functions
nadr0 Jul 11, 2025
263f4b4
fix: writing some more unit tests
nadr0 Jul 11, 2025
2d8fdb5
fix: adding a migration step for token.txt to production
nadr0 Jul 11, 2025
3bb6c69
fix: adding pool workflow
nadr0 Jul 11, 2025
3853ef2
chore: getting pools configured
nadr0 Jul 11, 2025
92b10e5
fix: trying to set default values for the new application commands
nadr0 Jul 11, 2025
2425ae1
fix: default pool value
nadr0 Jul 14, 2025
de3de30
fix: sign out of all environments on desktop
nadr0 Jul 14, 2025
ef4c208
chore: updating the advanced sign in page, dev mode to start, look at…
nadr0 Jul 15, 2025
fa82f65
chore: moving state up to have the sign in page know the new state fo…
nadr0 Jul 15, 2025
866b622
chore: updating memory, disk and reading from disk for the pool confi…
nadr0 Jul 15, 2025
b31517c
chore: testing the prod binary logic with the correct NODE_ENV set
nadr0 Jul 15, 2025
0d5dcfe
chore: trying to design the widget popover
nadr0 Jul 15, 2025
bedb8c2
fix: auto fmt
nadr0 Jul 15, 2025
582e76c
chore: formatting text for .env
nadr0 Jul 15, 2025
631b670
fix: auto fmt
nadr0 Jul 15, 2025
6e132c2
chore: trying to fix some display issues
nadr0 Jul 15, 2025
fa05e26
fix: cleaning, the sign out all will be moved to the user menu
nadr0 Jul 16, 2025
ed8b655
fix: adding more commands to the user menu, need to filter them now
nadr0 Jul 16, 2025
35330b6
chore: sign out of all envs instead of clearing cache
nadr0 Jul 16, 2025
923e319
fix: adding more logic for localhost, need to clean up some of the lo…
nadr0 Jul 16, 2025
f825a4f
fix: moving specific logic to a helper function
nadr0 Jul 16, 2025
e457d29
fix: fmt?
nadr0 Jul 16, 2025
fb5884a
chore: merged main
nadr0 Jul 16, 2025
7729f79
chore: adding unit tetss for getEnvironmentNameDisplay
nadr0 Jul 16, 2025
2c3f364
chore: cleaning up shorthand for environments, adding unit tests for …
nadr0 Jul 16, 2025
4190314
fix: cleaning up PR
nadr0 Jul 16, 2025
fa1a773
fix: trying to fix some bugs on the home page
nadr0 Jul 16, 2025
44c227f
fix: fmt
nadr0 Jul 16, 2025
4a1bbb4
fix: hiding content if you are in production or web
nadr0 Jul 16, 2025
2ae5027
fix: linter and fmt
nadr0 Jul 16, 2025
d5eb888
fix: trying to solve tsc issues
nadr0 Jul 16, 2025
8de5532
fix: removing old function
nadr0 Jul 16, 2025
37e6ac3
fix: auto fmt
nadr0 Jul 16, 2025
cd49e83
Merge branch 'main' into nadro/adhoc/environment-based-login
nadr0 Jul 16, 2025
4822ef5
fix: fixing tsc errors by making another helper functiont to wrap my …
nadr0 Jul 16, 2025
2d1807e
Update snapshots
github-actions[bot] Jul 16, 2025
5e82d59
Update snapshots
github-actions[bot] Jul 16, 2025
aed7eee
fix: floating '
nadr0 Jul 16, 2025
b6c5291
Merge branch 'nadro/adhoc/environment-based-login' of github.com:Kitt…
nadr0 Jul 16, 2025
ca1fce5
fix: I think this correct?
nadr0 Jul 16, 2025
47e6a07
chore: big brick, big refactor of base domain
nadr0 Jul 17, 2025
8908e2a
fix: trying a massive clean up
nadr0 Jul 17, 2025
29f161a
fix: add builds from removal
nadr0 Jul 17, 2025
100cb17
fix: making some progress
nadr0 Jul 17, 2025
39c2418
fix: fixing some linter errors
nadr0 Jul 17, 2025
54152cd
fix: linters for time being, i have a lot of commented code
nadr0 Jul 17, 2025
8c6629c
fix: more progress
nadr0 Jul 17, 2025
b725668
fix: closer?
nadr0 Jul 17, 2025
0607e7d
chore: looking good!
nadr0 Jul 17, 2025
f6e7465
fix: large cleanup
nadr0 Jul 17, 2025
232c2b7
fix: still need a few things
nadr0 Jul 17, 2025
9b48ead
fix: fmt
nadr0 Jul 18, 2025
5e4e647
fix: initializing the sign in page with desktop stuff since it isn't …
nadr0 Jul 18, 2025
1bb0e6a
fix: fixing loading logic on the home page and passing during sign in
nadr0 Jul 18, 2025
a128cda
chore: adding comment for websocket ur override in .env.development
nadr0 Jul 18, 2025
8595a24
fix: removing NODE_ENV check, only hide on web
nadr0 Jul 18, 2025
6e169bf
chore: remove debug copy, it is following the same flow for all ways …
nadr0 Jul 18, 2025
6ea897b
fix: cleanup
nadr0 Jul 18, 2025
878383e
fix: should not be an env check, should be a desktop check
nadr0 Jul 18, 2025
03ecae3
fix: typo on environment variable configuration for production
nadr0 Jul 18, 2025
92c6d51
fix: display of the base domain was wrong, it needs to be based on th…
nadr0 Jul 18, 2025
02a4ab3
chore: implementing sign out all environments
nadr0 Jul 18, 2025
0aa5b06
fix: multiple sign out fix and showing and hiding it in the user menu
nadr0 Jul 18, 2025
a9c7460
fix: hiding clear if pool is auto
nadr0 Jul 18, 2025
1949dda
chore: auto parse url, hide clear when needed, sign out of all
nadr0 Jul 18, 2025
da50f8c
chore: merging main
nadr0 Jul 18, 2025
7289cce
fix: file is empty now.
nadr0 Jul 18, 2025
fe52cce
fix: fixing a bug! A unit test actually caught this
nadr0 Jul 18, 2025
acdbc4f
fix: fixing env.test.ts
nadr0 Jul 18, 2025
460a461
fix: fixing src/lib/desktop.test.ts
nadr0 Jul 18, 2025
a94aa5a
fix: by default .env.development will not have this thus process.env …
nadr0 Jul 21, 2025
09665d9
fix: vite will not have this either...
nadr0 Jul 21, 2025
06a9854
Merge branch 'main' into nadro/adhoc/environment-based-login
nadr0 Jul 21, 2025
2f2f4ff
chore: cache wasm result for the collect recursive function, it does …
nadr0 Jul 21, 2025
a27373d
Merge branch 'nadro/adhoc/environment-based-login' of github.com:Kitt…
nadr0 Jul 21, 2025
6ff0662
Merge branch 'main' into nadro/adhoc/environment-based-login
nadr0 Jul 21, 2025
984606a
fix: can run isDesktop in electron now
nadr0 Jul 21, 2025
adce7fa
chore: adding unit test for generating urls
nadr0 Jul 21, 2025
a49a842
fix: removing todo
nadr0 Jul 21, 2025
a22083c
fix: localhost debugging
nadr0 Jul 21, 2025
ebfe8f5
fix: addressed duplicate id for status bar item
nadr0 Jul 22, 2025
0c39528
fix: leaving a TODO Reminder for the future
nadr0 Jul 22, 2025
8227e7f
fix: updated confusing console log statements to say empty string ins…
nadr0 Jul 22, 2025
99be28d
fix: updating the unit test strings to match the subdomain
nadr0 Jul 22, 2025
c053292
fix: updating old comment to provide a subdomain example
nadr0 Jul 22, 2025
07efce7
fix: improve comment to make it more clear
nadr0 Jul 22, 2025
a9ae3e3
fix: cleaning up confusing variable names, removing everything relate…
nadr0 Jul 22, 2025
6cbff9d
fix: two if statements into an if else, logic is the same
nadr0 Jul 22, 2025
2220954
fix: if statement cruly braces for improved reading
nadr0 Jul 22, 2025
572c2e9
fix: removing unused variable from previous advancedsigninoptions gui
nadr0 Jul 22, 2025
669921b
fix: missing away on async function, ope
nadr0 Jul 22, 2025
36dffd1
fix: fixing pool on localhost, allows web socket url to be overwritte…
nadr0 Jul 22, 2025
650c1e5
fix: fixing websocket .env.development.local override
nadr0 Jul 22, 2025
a5b36c5
fix: python codespell typo check
nadr0 Jul 22, 2025
1f09c3c
fix: improved substring logic since it could replace a valid string
nadr0 Jul 22, 2025
2805c9d
fix: updated a console log to be more helpful when debugging
nadr0 Jul 22, 2025
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
6 changes: 2 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
NODE_ENV=development

# App
VITE_KITTYCAD_API_BASE_URL=https://api.dev.zoo.dev
VITE_KITTYCAD_API_WEBSOCKET_URL=wss://api.dev.zoo.dev/ws/modeling/commands
VITE_KITTYCAD_BASE_DOMAIN=dev.zoo.dev
#VITE_KITTYCAD_API_TOKEN="required for testing, optional to skip auth in the app"
VITE_KITTYCAD_SITE_BASE_URL=https://dev.zoo.dev
VITE_KITTYCAD_SITE_APP_URL=https://app.dev.zoo.dev
#VITE_WASM_BASE_URL="optional override of Wasm URL if not on default port 3000"
#VITE_KITTYCAD_API_WEBSOCKET_URL="optional override for engine websocket url"
FAIL_ON_CONSOLE_ERRORS=true

# KCL
Expand Down
5 changes: 1 addition & 4 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
NODE_ENV=production

# App
VITE_KITTYCAD_API_BASE_URL=https://api.zoo.dev
VITE_KITTYCAD_API_WEBSOCKET_URL=wss://api.zoo.dev/ws/modeling/commands
VITE_KITTYCAD_SITE_BASE_URL=https://zoo.dev
VITE_KITTYCAD_SITE_APP_URL=https://app.zoo.dev
VITE_KITTYCAD_BASE_DOMAIN=zoo.dev
4 changes: 1 addition & 3 deletions interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ export interface IElectronAPI {
process: {
env: {
NODE_ENV: string
VITE_KITTYCAD_API_BASE_URL: string
VITE_KITTYCAD_BASE_DOMAIN: string
VITE_KITTYCAD_API_WEBSOCKET_URL: string
VITE_KITTYCAD_API_TOKEN: string
VITE_KITTYCAD_SITE_BASE_URL: string
VITE_KITTYCAD_SITE_APP_URL: string
}
}
kittycad: (access: string, args: any) => any
Expand Down
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import type { StatusBarItemType } from '@src/components/StatusBar/statusBarTypes
import { UndoRedoButtons } from '@src/components/UndoRedoButtons'
import { Toolbar } from '@src/Toolbar'
import { withSiteBaseURL } from '@src/lib/withBaseURL'
import env from '@src/env'

// CYCLIC REF
sceneInfra.camControls.engineStreamActor = engineStreamActor
Expand All @@ -92,7 +93,7 @@ export function App() {

// Stream related refs and data
const [searchParams] = useSearchParams()
const pool = searchParams.get('pool')
const pool = searchParams.get('pool') || env().POOL || null

const projectName = project?.name || null
const projectPath = project?.path || null
Expand Down
26 changes: 26 additions & 0 deletions src/components/StatusBar/defaultStatusBarItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import { isDesktop } from '@src/lib/isDesktop'
import { APP_DOWNLOAD_PATH } from '@src/lib/constants'
import { desktopAppPitchMessage } from '@src/components/DownloadAppToast'
import { withSiteBaseURL } from '@src/lib/withBaseURL'
import {
EnvironmentChip,
EnvironmentDescription,
} from '@src/components/environment/Environment'

export const defaultGlobalStatusBarItems = ({
location,
Expand Down Expand Up @@ -43,6 +47,10 @@ export const defaultGlobalStatusBarItems = ({
children: desktopAppPitchMessage,
},
},
{
id: 'environment',
component: EnvironmentStatusBarItem,
},
{
id: 'telemetry',
element: 'link',
Expand Down Expand Up @@ -101,6 +109,24 @@ function BillingStatusBarItem() {
)
}

function EnvironmentStatusBarItem() {
return isDesktop() ? (
<Popover className="relative flex items-stretch">
<Popover.Button
className="m-0 p-0 border-0 flex items-stretch"
data-testid="environment-subdomain-bar"
>
<EnvironmentChip />
</Popover.Button>
<Popover.Panel className="absolute left-0 bottom-full mb-1 w-64 flex flex-col gap-1 align-stretch rounded-lg shadow-lg text-sm">
<EnvironmentDescription />
</Popover.Panel>
</Popover>
) : (
<></>
)
}

export const defaultLocalStatusBarItems: StatusBarItemType[] = [
{
id: 'help',
Expand Down
61 changes: 58 additions & 3 deletions src/components/UserSidebarMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Popover, Transition } from '@headlessui/react'
import type { Models } from '@kittycad/lib'
import { Fragment, useMemo, useState } from 'react'
import { Fragment, useEffect, useMemo, useState } from 'react'
import { useLocation, useNavigate } from 'react-router-dom'

import type { ActionButtonProps } from '@src/components/ActionButton'
Expand All @@ -14,9 +14,14 @@
import { authActor } from '@src/lib/singletons'
import { reportRejection } from '@src/lib/trap'
import { withSiteBaseURL } from '@src/lib/withBaseURL'
import env from '@src/env'
import { commandBarActor } from '@src/lib/singletons'
import { listAllEnvironmentsWithTokens } from '@src/lib/desktop'

type User = Models['User_type']

let didListEnvironments = false

const UserSidebarMenu = ({ user }: { user?: User }) => {
const platform = usePlatform()
const location = useLocation()
Expand All @@ -25,6 +30,22 @@
const [imageLoadFailed, setImageLoadFailed] = useState(false)
const navigate = useNavigate()
const send = authActor.send
const fullEnvironmentName = env().VITE_KITTYCAD_BASE_DOMAIN
const [hasMultipleEnvironments, setHasMultipleEnvironments] = useState(false)

useEffect(() => {
if (!didListEnvironments) {
didListEnvironments = true
listAllEnvironmentsWithTokens()
.then((environmentsWithTokens) => {
setHasMultipleEnvironments(environmentsWithTokens.length > 1)
})
.catch(reportRejection)
}
}, [])

// Do not show the environment items on web
const hideEnvironmentItems = !isDesktop()

// We filter this memoized list so that no orphan "break" elements are rendered.
const userMenuItems = useMemo<(ActionButtonProps | 'break')[]>(
Expand Down Expand Up @@ -141,20 +162,54 @@
children: <span className="flex-1">Check for updates</span>,
},
'break',
{
id: 'change-environment',
Element: 'button',
children: <span>Change environment</span>,

Check warning on line 168 in src/components/UserSidebarMenu.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Change environment. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
onClick: () => {
const environment = env().VITE_KITTYCAD_BASE_DOMAIN
if (environment) {
commandBarActor.send({
type: 'Find and select command',
data: {
groupId: 'application',
name: 'switch-environments',
argDefaultValues: {
environment,
},
},
})
}
},
className: hideEnvironmentItems ? 'hidden' : '',
},
{
id: 'sign-out',
Element: 'button',
'data-testid': 'user-sidebar-sign-out',
children: 'Sign out',
children: (
<span>
Sign out{hideEnvironmentItems ? '' : ` of ${fullEnvironmentName}`}
</span>
),

Check warning on line 194 in src/components/UserSidebarMenu.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Sign out. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
onClick: () => send({ type: 'Log out' }),
className: '', // Just making TS's filter type coercion happy 😠
},
{
id: 'sign-out-all',
Element: 'button',
'data-testid': 'user-sidebar-sign-out',
children: <span>Sign out of all environments</span>,

Check warning on line 202 in src/components/UserSidebarMenu.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Sign out of all environments. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
onClick: () => send({ type: 'Log out all' }),
className:
hideEnvironmentItems || !hasMultipleEnvironments ? 'hidden' : '',
},
].filter(
(props) =>
props === 'break' ||
(typeof props !== 'string' && !props.className?.includes('hidden'))
) as (ActionButtonProps | 'break')[],
[platform, location, filePath, navigate, send]
[platform, location, filePath, navigate, send, hasMultipleEnvironments]
)

// This image host goes down sometimes. We will instead rewrite the
Expand Down
121 changes: 121 additions & 0 deletions src/components/environment/Environment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import { ActionButton } from '@src/components/ActionButton'
import { commandBarActor } from '@src/lib/singletons'
import env from '@src/env'
import { writeEnvironmentConfigurationPool } from '@src/lib/desktop'
import { reportRejection } from '@src/lib/trap'

export function EnvironmentChip() {
const shorthand = env().VITE_KITTYCAD_BASE_DOMAIN
const pool = env().POOL
return (
<div className="flex items-center px-2 py-1 text-xs text-chalkboard-80 dark:text-chalkboard-30 rounded-none border-none hover:bg-chalkboard-30 dark:hover:bg-chalkboard-80 focus:bg-chalkboard-30 dark:focus:bg-chalkboard-80 hover:text-chalkboard-100 dark:hover:text-chalkboard-10 focus:text-chalkboard-100 dark:focus:text-chalkboard-10 focus:outline-none focus-visible:ring-2 focus:ring-primary focus:ring-opacity-50">
<span className="">
{shorthand} {pool ? `+ Pool` : ''}
</span>
</div>
)
}

export function EnvironmentDescription() {
const fullEnvironmentName = env().VITE_KITTYCAD_BASE_DOMAIN
return (
<div className="absolute left-2 bottom-full mb-1 flex-col gap-1 align-stretch bg-chalkboard-10 dark:bg-chalkboard-90 rounded shadow-lg border border-solid border-chalkboard-20/50 dark:border-chalkboard-80/50 text-sm">
<div
className={`flex flex-col p-2 mb-2 rounded-t-sm bg-chalkboard-20 text-chalkboard-100`}
>
<p className="flex flex-row justify-between">
<h2 className="text-sm font-sans font-normal">Environment</h2>

Check warning on line 27 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Environment. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<p
data-testid="environment"
className="text-xs rounded-sm flex flex-row items-center"
>
<ActionButton
Element="button"
onClick={() => {
const environment = env().VITE_KITTYCAD_BASE_DOMAIN
if (environment) {
commandBarActor.send({
type: 'Find and select command',
data: {
groupId: 'application',
name: 'switch-environments',
argDefaultValues: {
environment,
},
},
})
}
}}
iconEnd={{ icon: 'sketch', bgClassName: '!bg-transparent' }}
className="ml-1 pr-0"
>
{fullEnvironmentName}
</ActionButton>
</p>
</p>
</div>
<ul>
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 ">
<p className="text-chalkboard-100">API</p>{' '}

Check warning on line 59 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized API. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<p className="text-chalkboard-60">
{env().VITE_KITTYCAD_API_BASE_URL}
</p>
</li>
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 ">
<p className="text-chalkboard-100">Site</p>{' '}

Check warning on line 65 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Site. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<p className="text-chalkboard-60">
{env().VITE_KITTYCAD_SITE_BASE_URL}
</p>
</li>
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 ">
<p className="text-chalkboard-100">WebSocket (real-time-data)</p>{' '}

Check warning on line 71 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized WebSocket realtimedata. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<p className="text-chalkboard-60">
{env().VITE_KITTYCAD_API_WEBSOCKET_URL}
</p>
</li>
<li className="flex flex-col px-2 py-2 gap-1 last:mb-0 ">
<p className="text-chalkboard-100">Connection Pool</p>{' '}

Check warning on line 77 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Connection Pool. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<p className="text-chalkboard-60 flex flex-row justify-between">
<span>{env().POOL || 'Auto'}</span>
<div className="flex flex-row gap-1">
<ActionButton
Element="button"
onClick={() => {
commandBarActor.send({
type: 'Find and select command',
data: {
groupId: 'application',
name: 'choose-pool',
argDefaultValues: {
pool: env().POOL,
},
},
})
}}
>
<span className="py-2 lg:py-0">Edit</span>

Check warning on line 96 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Edit. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
</ActionButton>
{env().POOL !== '' && (
<ActionButton
onClick={() => {
const environment = env().VITE_KITTYCAD_BASE_DOMAIN
if (environment) {
writeEnvironmentConfigurationPool(environment, '')
.then(() => {
window.location.reload()
})
.catch(reportRejection)
}
}}
Element="button"
>
<span className="py-2 lg:py-0">Clear</span>

Check warning on line 112 in src/components/environment/Environment.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Clear. You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
</ActionButton>
)}
</div>
</p>
</li>
</ul>
</div>
)
}
Loading
Loading