Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 24 additions & 4 deletions messages/renderer/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,30 @@
"description": "Fallback name for observation without a matching category.",
"message": "Observation"
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.accessibleNotesInputLabel": {
"description": "Accessible label for notes input field.",
"message": "Notes"
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.cancelButtonText": {
"description": "Text for cancel button.",
"message": "Cancel"
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.editNotesTooltip": {
"description": "Text for tooltip when hovering over notes.",
"message": "Click to Edit"
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.noNotes": {
"description": "Text for when notes are empty.",
"message": "No notes."
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.saveButtonText": {
"description": "Text for save button.",
"message": "Save"
},
"routes.app.projects.$projectId.observations.$observationDocId.-notes-section.title": {
"description": "Title for notes section.",
"message": "Notes"
},
"routes.app.projects.$projectId.observations.$observationDocId.index.categoryIconAlt": {
"description": "Alt text for icon image displayed for category (used for accessibility tools).",
"message": "Icon for {name} category"
Expand Down Expand Up @@ -321,10 +345,6 @@
"description": "Fallback for location when observation does not have location specified.",
"message": "No location"
},
"routes.app.projects.$projectId.observations.$observationDocId.index.notesSectionTitle": {
"description": "Title for notes section.",
"message": "Notes"
},
"routes.app.projects.$projectId.observations.$observationDocId.index.observationCategoryNameFallback": {
"description": "Fallback name for observation without a matching category.",
"message": "Observation"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/renderer/icons/material-edit-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 53 additions & 46 deletions src/renderer/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import {
ActiveProjectIdStoreProvider,
createActiveProjectIdStore,
} from './contexts/active-project-id-store-context'
import {
GlobalEditingStateStoreProvider,
createGlobalEditingStateStore,
} from './contexts/global-editing-state-store-context'
import { IntlProvider } from './contexts/intl'
import {
LocalPeersStoreProvider,
Expand Down Expand Up @@ -129,6 +133,7 @@ const { platform } = window.runtime.getAppInfo()
const MAIN_CONTENT_HEIGHT =
platform === 'darwin' ? `calc(100% - ${TITLE_BAR_HEIGHT})` : '100%'

const globalEditingStateStore = createGlobalEditingStateStore()
const refreshTokensStore = createRefreshTokensStore()
const localPeersStore = createLocalPeersStore({ clientApi })
const activeProjectIdStore = createActiveProjectIdStore({
Expand Down Expand Up @@ -156,53 +161,55 @@ export function App() {
<CssBaseline enableColorScheme />

<RefreshTokensStoreProvider value={refreshTokensStore}>
<ActiveProjectIdStoreProvider value={activeProjectIdStore}>
<QueryClientProvider client={queryClient}>
<IntlProvider>
<NetworkConnectionChangeListener />

<Box height="100dvh">
{platform === 'darwin' ? (
<AppTitleBar platform={platform} testId="app-title-bar" />
) : null}

<Box height={MAIN_CONTENT_HEIGHT}>
<Suspense
fallback={
<Box
display="flex"
justifyContent="center"
alignItems="center"
height="100%"
>
<CircularProgress />
</Box>
}
>
<ClientApiProvider clientApi={clientApi}>
<LocalPeersStoreProvider value={localPeersStore}>
<WithInvitesListener>
<WithAddedRouteContext>
{({ formatMessage, localeState }) => (
<RouterProvider
router={router}
context={{
activeProjectIdStore,
formatMessage,
localeState,
}}
/>
)}
</WithAddedRouteContext>
</WithInvitesListener>
</LocalPeersStoreProvider>
</ClientApiProvider>
</Suspense>
<GlobalEditingStateStoreProvider value={globalEditingStateStore}>
<ActiveProjectIdStoreProvider value={activeProjectIdStore}>
<QueryClientProvider client={queryClient}>
<IntlProvider>
<NetworkConnectionChangeListener />

<Box height="100dvh">
{platform === 'darwin' ? (
<AppTitleBar platform={platform} testId="app-title-bar" />
) : null}

<Box height={MAIN_CONTENT_HEIGHT}>
<Suspense
fallback={
<Box
display="flex"
justifyContent="center"
alignItems="center"
height="100%"
>
<CircularProgress />
</Box>
}
>
<ClientApiProvider clientApi={clientApi}>
<LocalPeersStoreProvider value={localPeersStore}>
<WithInvitesListener>
<WithAddedRouteContext>
{({ formatMessage, localeState }) => (
<RouterProvider
router={router}
context={{
activeProjectIdStore,
formatMessage,
localeState,
}}
/>
)}
</WithAddedRouteContext>
</WithInvitesListener>
</LocalPeersStoreProvider>
</ClientApiProvider>
</Suspense>
</Box>
</Box>
</Box>
</IntlProvider>
</QueryClientProvider>
</ActiveProjectIdStoreProvider>
</IntlProvider>
</QueryClientProvider>
</ActiveProjectIdStoreProvider>
</GlobalEditingStateStoreProvider>
</RefreshTokensStoreProvider>
</ThemeProvider>
</StrictMode>
Expand Down
49 changes: 49 additions & 0 deletions src/renderer/src/contexts/global-editing-state-store-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { createContext, use } from 'react'
import { createStore, useStore } from 'zustand'

export type GlobalEditingStateStore = ReturnType<
typeof createGlobalEditingStateStore
>

export type GlobalEditingState = boolean

export function createGlobalEditingStateStore(opts?: {
initialValue: GlobalEditingState
}) {
const store = createStore<GlobalEditingState>(() => {
return !!opts?.initialValue
})

const actions = {
update: (value: GlobalEditingState) => {
store.setState(value)
},
}

return { instance: store, actions }
}

const GlobalEditingStateStoreContext =
createContext<GlobalEditingStateStore | null>(null)
export const GlobalEditingStateStoreProvider =
GlobalEditingStateStoreContext.Provider

function useGlobalEditingStateStore() {
const value = use(GlobalEditingStateStoreContext)

if (!value) {
throw new Error('Must set up GlobalEditingStateStoreProvider first')
}

return value
}

export function useGlobalEditingState(): GlobalEditingState {
const store = useGlobalEditingStateStore()
return useStore(store.instance)
}

export function useGlobalEditingStateActions() {
const store = useGlobalEditingStateStore()
return store.actions
}
4 changes: 3 additions & 1 deletion src/renderer/src/generated/icons.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ export const iconNames = [
'material-expand-more',
'material-expand-less',
'material-error',
'material-edit-filled',
'material-close',
'material-circle-filled',
'material-chevron-right',
'material-check',
'material-check-circle',
'material-check-circle-rounded',
'material-check-circle-outline-rounded',
'material-category',
'material-bolt',
'material-auto-fix-high',
Expand Down
18 changes: 17 additions & 1 deletion src/renderer/src/images/icons-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/renderer/src/routes/app/projects/$projectId/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ function SuccessPanel({
gap={6}
>
<Box padding={6}>
<Icon name="material-check-circle" htmlColor={GREEN} size={160} />
<Icon
name="material-check-circle-rounded"
htmlColor={GREEN}
size={160}
/>
</Box>

<Typography variant="h1" fontWeight={500} textAlign="center">
Expand Down
Loading