Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
adf2a53
feat(ui): new menu and cardgrid uis and stories
yannisbarlas Jun 26, 2026
cc2507f
feat(client): implement new menu in actual app
yannisbarlas Jun 30, 2026
ef72bfc
Merge branch 'theme' into menu
yannisbarlas Jun 30, 2026
78b44b8
feat(ui): more page ui improvements
yannisbarlas Jun 30, 2026
f109138
ci(ui): adjust gray background color
yannisbarlas Jun 30, 2026
1445d5c
feat(ui): add spectral-sc as font for page titles
yannisbarlas Jun 30, 2026
2e16b7a
feat(ui): fix positioning issues and add breadcrumb component
yannisbarlas Jul 6, 2026
e04e4bb
Merge branch 'theme' into menu
yannisbarlas Jul 6, 2026
7c808fe
feat(ui): update with coar and centralize icons
yannisbarlas Jul 6, 2026
1aa75a9
Merge branch 'theme' into menu
yannisbarlas Jul 7, 2026
fcd6664
fix(ui): use translations for user roles in menu
yannisbarlas Jul 7, 2026
ac0100f
fix(ui): use translations for menu items
yannisbarlas Jul 7, 2026
7fc2c4d
feat(ui): add notification ui
yannisbarlas Jul 8, 2026
9e4a97f
refactor(ui): migrate coar and semantic scholar icons to centralized …
yannisbarlas Jul 8, 2026
f932559
fix(client): correct notification settings
yannisbarlas Jul 8, 2026
658c3d8
refactor(client): centralize logout implementation
yannisbarlas Jul 8, 2026
d301dc8
fix(ui): fix login button hover state
yannisbarlas Jul 9, 2026
cb7912b
feat(ui): add page descriptions for forms and cms pages
yannisbarlas Jul 9, 2026
71ba4a7
feat(ui): use translations for forms and cms pagees
yannisbarlas Jul 9, 2026
e183baa
fix(ui): fix page heights and double scrollbars
yannisbarlas Jul 9, 2026
6dde886
feat(ui): menu accessibility
yannisbarlas Jul 9, 2026
3fa0299
feat(ui): card grid accessibility and coko client version bump
yannisbarlas Jul 10, 2026
fbeb231
fix(ui): fix hardcoded css values to use the theme
yannisbarlas Jul 10, 2026
7bfbdfa
chore(ui): drop old menu implementation
yannisbarlas Jul 10, 2026
9851131
chore(models): drop unused menu_pinned column and related mutation
yannisbarlas Jul 10, 2026
427a1ee
refactor(client): clean up menu translation usage
yannisbarlas Jul 10, 2026
2b40512
chore(ui): clean up unused theme values
yannisbarlas Jul 10, 2026
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
5 changes: 5 additions & 0 deletions packages/client/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ import { defineMain } from '@storybook/react-vite/node'
export default defineMain({
framework: '@storybook/react-vite',
stories: ['../stories/**/*.stories.tsx'],
addons: ['@storybook/addon-docs'],
viteFinal: async config => {
config.define = { ...config.define, 'process.env': {} }
return config
},
})
20 changes: 20 additions & 0 deletions packages/client/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<style>
/* Storybook's Docs page applies a class of '.sb-show-main'
or renders inside a specific container layout.
This target breaks your app's restrictions ONLY inside Storybook.
*/
html,
body {
overflow: auto !important;
display: block !important;
height: auto !important;
min-height: 100vh !important;
overscroll-behavior-y: auto !important;
}

/* Ensures the root wrapper can grow naturally with the docs content */
#root {
height: auto !important;
min-height: 100% !important;
}
</style>
13 changes: 0 additions & 13 deletions packages/client/.storybook/preview.ts

This file was deleted.

69 changes: 69 additions & 0 deletions packages/client/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* eslint-disable import/no-extraneous-dependencies */

import { definePreview, type Decorator } from '@storybook/react-vite'
import addonDocs from '@storybook/addon-docs'

import { MemoryRouter, Route, Routes } from 'react-router-dom'
import { ThemeProvider } from 'styled-components'
import { I18nextProvider } from 'react-i18next'
import { AntConfigProvider } from '@coko/client'

import { makeTheme } from '../app/theme'
import GlobalStyle from '../app/theme/elements/GlobalStyle'
import i18next from '../app/i18n'

const theme = makeTheme()

const withProviders: Decorator = (Story, context) => {
const initialEntries = context.parameters?.router?.initialEntries ?? ['/']
const routePath = context.parameters?.router?.path

const content = (
<ThemeProvider theme={theme}>
<I18nextProvider i18n={i18next}>
<AntConfigProvider theme={theme}>
<GlobalStyle />
<div
onClick={e => {
const anchor = (e.target as HTMLElement).closest('a')
if (anchor) {
/* eslint-disable-next-line no-console */
console.log('navigate to:', anchor.getAttribute('href'))
}
}}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
const anchor = (e.target as HTMLElement).closest('a')
if (anchor) {
/* eslint-disable-next-line no-console */
console.log('navigate to:', anchor.getAttribute('href'))
}
}
}}
role="presentation"
>
<Story />
</div>
</AntConfigProvider>
</I18nextProvider>
</ThemeProvider>
)

return (
<MemoryRouter initialEntries={initialEntries}>
{routePath ? (
<Routes>
<Route element={content} path={routePath} />
</Routes>
) : (
content
)}
</MemoryRouter>
)
}

export default definePreview({
addons: [addonDocs()],
tags: ['autodocs'],
decorators: [withProviders],
})
49 changes: 31 additions & 18 deletions packages/client/app/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ import UsersPage from './components/component-users-manager/src/UsersPage'
import { ConfigContext } from './components/config/src'
import { XpubContext } from './components/xpub-with-context/src'

import { AuthenticatedPage, GroupPage, MenuPage } from './pages'
import {
AuthenticatedPage,
CMSPage,
FormsPage,
GroupPage,
MenuPage,
} from './pages'

import { CURRENT_USER } from './queries'

Expand Down Expand Up @@ -107,16 +113,19 @@ const RoleGate = (props: RoleGateProps): ReactNode => {
*/
const DashboardRoutes = (): ReactNode => {
const config = useContext(ConfigContext)
// @ts-ignore
const dashboard = config?.dashboard

return (
<Routes>
<Route element={<DashboardRedirect />} path="" />
{config?.dashboard?.showSections?.includes('submission') && (
{dashboard?.showSections?.includes('submission') && (
<Route element={<DashboardSubmissionsPage />} path="submissions" />
)}
{config?.dashboard?.showSections?.includes('review') && (
{dashboard?.showSections?.includes('review') && (
<Route element={<DashboardReviewsPage />} path="reviews" />
)}
{config?.dashboard?.showSections?.includes('editor') && (
{dashboard?.showSections?.includes('editor') && (
<Route element={<DashboardEditsPage />} path="edits" />
)}
</Routes>
Expand Down Expand Up @@ -216,35 +225,39 @@ const Router = (): ReactNode => {
>
<Route element={<ReportPage />} path="reports" />

<Route element={<FormsPage />} path="forms" />

<Route
element={<FormBuilderPage category="submission" />}
path="submission-form-builder"
path="forms/submission-form-builder"
/>

<Route
element={<FormBuilderPage category="review" />}
path="review-form-builder"
path="forms/review-form-builder"
/>

<Route
element={<FormBuilderPage category="decision" />}
path="decision-form-builder"
path="forms/decision-form-builder"
/>

<Route element={<UsersPage />} path="users" />
<Route element={<TasksTemplatePage />} path="tasks" />

<Route path="cms">
<Route element={<CMSPagesPage />} path="pages/:pageId?" />
<Route element={<CMSLayoutPage />} path="layout" />
<Route element={<CMSArticlePage />} path="article" />
<Route element={<CMSFileBrowserPage />} path="filebrowser" />
<Route element={<CMSMetadataPage />} path="metadata" />
<Route
element={<CMSPublishingCollectionPage />}
path="collections"
/>
</Route>
<Route element={<CMSPage />} path="cms" />
<Route element={<CMSPagesPage />} path="cms/pages/:pageId?" />
<Route element={<CMSLayoutPage />} path="cms/layout" />
<Route element={<CMSArticlePage />} path="cms/article" />
<Route
element={<CMSFileBrowserPage />}
path="cms/filebrowser"
/>
<Route element={<CMSMetadataPage />} path="cms/metadata" />
<Route
element={<CMSPublishingCollectionPage />}
path="cms/collections"
/>

<Route element={<ConfigManagerPage />} path="configuration" />
</Route>
Expand Down
119 changes: 0 additions & 119 deletions packages/client/app/components/Menu.jsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ const ChatBubble = ({ forceHide, icons, hasApiKey }) => {
width: '35px',
height: '35px',
borderRadius: '50%',
backgroundColor: theme.color.brand1.base(),
border: theme.color.brand1.shade50(),
backgroundColor: theme.color.brand1.base,
border: theme.color.brand1.shade50,
textAlign: 'center',
color: '#fff',
}}
Expand Down
Loading
Loading