Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: keep top padding constant between Conversations and Automations (#268)

Hiep Le4b0f7d6b6e8e
diff --git a/__tests__/components/features/sidebar/sidebar.test.tsx b/__tests__/components/features/sidebar/sidebar.test.tsx
index cf5c2d0d60..c09226ca93 100644
--- a/__tests__/components/features/sidebar/sidebar.test.tsx
+++ b/__tests__/components/features/sidebar/sidebar.test.tsx
@@ -97,25 +97,17 @@ function renderSidebar(currentPath: string) {
}
describe("Sidebar", () => {
- it.each([["/automations"], ["/automations/abc-123"]])(
- "applies the standalone vertical padding on %s so the sidebar has breathing room when the root layout's padding is dropped",
+ it.each([["/conversations"], ["/automations"], ["/automations/abc-123"], ["/settings"]])(
+ "keeps the sidebar's default top padding on %s so spacing stays consistent with the conversations page",
(currentPath) => {
renderSidebar(currentPath);
const sidebar = screen.getByRole("navigation").parentElement;
- expect(sidebar?.className).toMatch(/(^|\s)md:pt-6\.5(\s|$)/);
- expect(sidebar?.className).toMatch(/(^|\s)md:pb-3(\s|$)/);
+ expect(sidebar?.className).toMatch(/(^|\s)md:pt-4(\s|$)/);
+ expect(sidebar?.className).not.toMatch(/(^|\s)md:pt-6\.5(\s|$)/);
},
);
- it("does not apply the standalone vertical padding on routes that still use the root layout's padding", () => {
- renderSidebar("/settings");
-
- const sidebar = screen.getByRole("navigation").parentElement;
- expect(sidebar?.className).not.toMatch(/(^|\s)md:pt-6\.5(\s|$)/);
- expect(sidebar?.className).not.toMatch(/(^|\s)md:pb-3(\s|$)/);
- });
-
it("renders sidebar nav links and the settings toggle with the default text color shared by the settings page nav (text-[#8C8C8C])", () => {
renderSidebar("/skills");
diff --git a/src/components/features/sidebar/sidebar.tsx b/src/components/features/sidebar/sidebar.tsx
index a03d351663..daef214956 100644
--- a/src/components/features/sidebar/sidebar.tsx
+++ b/src/components/features/sidebar/sidebar.tsx
@@ -90,8 +90,7 @@ export function Sidebar() {
"h-[54px] md:h-full md:w-[300px] md:min-w-[300px]",
"px-3 py-2 md:px-3 md:pt-4",
"flex-row md:flex-col",
- (currentPath === "/" || currentPath.startsWith("/automations")) &&
- "md:pt-6.5 md:pb-3",
+ currentPath === "/" && "md:pt-6.5 md:pb-3",
)}
>
<div className="flex items-center md:px-2 md:py-1">