mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
docs: refresh screenshots, trim feature docs, and drop the New Repo sidebar CTA (#363)
This commit is contained in:
1 parent
be6c4108a6
commit
702e3c4e13
49 files changed
+26
-55
No files matched your search
@@ -104,7 +104,7 @@ describe('DesktopSidebar', () => {
|
||||
expect(container.firstChild).toBeNull()
|
||||
})
|
||||
|
||||
it('renders primary CTA for root path', () => {
|
||||
it('hides the New Repo CTA for root path and renders Assistant', () => {
|
||||
vi.spyOn(useDesktopModule, 'useDesktop').mockReturnValue(true)
|
||||
vi.spyOn(useSidebarCollapsedModule, 'useSidebarCollapsed').mockReturnValue([false, vi.fn()])
|
||||
vi.spyOn(useAuthModule, 'useAuth').mockReturnValue({
|
||||
@@ -115,7 +115,7 @@ describe('DesktopSidebar', () => {
|
||||
|
||||
render(<DesktopSidebar />, { wrapper: createWrapper(['/']) })
|
||||
|
||||
expect(screen.getByText('New Repo')).toBeInTheDocument()
|
||||
expect(screen.queryByText('New Repo')).toBeNull()
|
||||
expect(screen.getByText('Assistant')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -174,14 +174,14 @@ describe('DesktopSidebar', () => {
|
||||
logout: vi.fn(),
|
||||
} as any)
|
||||
|
||||
render(<DesktopSidebar />, { wrapper: createWrapper(['/']) })
|
||||
render(<DesktopSidebar />, { wrapper: createWrapper(['/schedules']) })
|
||||
|
||||
fireEvent.click(screen.getByText('New Repo'))
|
||||
fireEvent.click(screen.getByText('New Schedule'))
|
||||
|
||||
expect(dispatchEventSpy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
type: 'oc:sidebar:action',
|
||||
detail: { action: 'new-repo' },
|
||||
detail: { action: 'new-schedule' },
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
@@ -39,6 +39,7 @@ export function DesktopSidebar() {
|
||||
}
|
||||
|
||||
const { primary, items } = buildNavModel(location.pathname)
|
||||
const desktopPrimary = primary.filter((item) => item.key !== 'new-repo')
|
||||
|
||||
const handlePrimaryClick = (item: NavPrimaryCta) => {
|
||||
if (item.to) {
|
||||
@@ -84,9 +85,9 @@ export function DesktopSidebar() {
|
||||
return (
|
||||
<>
|
||||
<Sidebar collapsed={collapsed} onToggle={toggle} widthClass='w-72' className='mt-2'>
|
||||
{primary.length > 0 && (
|
||||
{desktopPrimary.length > 0 && (
|
||||
<SidebarSection collapsed={collapsed}>
|
||||
{primary.map((item: NavPrimaryCta) => (
|
||||
{desktopPrimary.map((item: NavPrimaryCta) => (
|
||||
<SidebarItem
|
||||
key={item.key}
|
||||
icon={item.icon}
|
||||
|
||||
Reference in new issue
Block a user