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
2 changes: 1 addition & 1 deletion src/renderer/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const Sidebar: FC = () => {

return (
<Stack
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar [&_svg]:text-white"
className="fixed w-sidebar h-full bg-gitify-sidebar [&_svg]:text-white"
direction="vertical"
justify="space-between"
>
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/__snapshots__/Sidebar.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 19 additions & 5 deletions src/renderer/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@ import type { FC, ReactNode } from 'react';

import { Sidebar } from '../Sidebar';

interface IAppLayout {
interface AppLayoutProps {
children: ReactNode;
}

/**
* AppLayout is the main container for the application.
* It handles the basic layout with sidebar and content area.
*/
export const AppLayout: FC<IAppLayout> = ({ children }) => {
export const AppLayout: FC<AppLayoutProps> = ({ children }) => {
const setFocusRef = (el: HTMLButtonElement | null) => {
if (el) {
el.focus();
}
};

return (
<div className="flex flex-col min-h-screen bg-gitify-background">
{/* Content first in DOM so initial focus won't land on sidebar buttons */}
<div className="flex-1 pl-sidebar">{children}</div>
<div className="flex min-h-screen bg-gitify-background">
{/* Hidden focus sentinel; grabs initial focus via callback ref */}
<button
aria-label="initial focus"
className="sr-only"
data-testid="initial-focus-sentinel"
ref={setFocusRef}
type="button"
/>

<Sidebar />

<div className="flex-1 pl-sidebar">{children}</div>
</div>
);
};
2 changes: 1 addition & 1 deletion src/renderer/components/layout/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FC, ReactNode } from 'react';

interface IPage {
children: ReactNode;
testId?: string;
testId: string;
}

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading