Skip to content

Commit d8add79

Browse files
Fixes to responsive styling (#1325)
* feat(editor): add new PostEditor component and E2E test infrastructure - Add PostEditor with WriteTab and LinkTab for article/link creation - Add URL metadata fetching for link posts - Add article toolbar with formatting options - Add E2E editor tests and test utilities - Update E2E setup with link post test data - Update slash command and image upload extensions * style: standardize formatting and clean up whitespace across multiple files * feat(editor): enhance CreateContent component with improved data handling and state management * feat: update UnifiedContentCard to display author username conditionally and prevent layout shift with scrollbar-gutter in globals.css * feat: update layout and styling for ArticlesPage, FeedPage, Home, and Filters components * style: refine layout and styling for FeedFilters component * test: enhance article sorting and visibility checks in e2e tests * fix: resolve ESLint errors and E2E test issues - Remove unused imports from layout.tsx (headers, ThemeProvider, etc.) - Remove unused sortAPIToUI mapping from articles/_client.tsx - Fix type parameter naming in Filters.tsx (prefix with underscore) - Fix networkidle usage in saved.spec.ts (use domcontentloaded) - Use platform-aware keyboard modifier in editor.spec.ts (Meta on Mac, Control on Linux) * Add journal entry for lowly gunslinger migration (version 7) * style: format JSON structure in 0017_snapshot.json and _journal.json for consistency * fix: make migration 0017 idempotent for CI compatibility
1 parent 08775f8 commit d8add79

File tree

16 files changed

+5033
-64
lines changed

16 files changed

+5033
-64
lines changed

.claude/commands/do-test.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
description: Run development verification checks (lint, build, and optionally e2e tests)
3+
argument-hint: "[e2e]"
4+
---
5+
6+
## Development Test Suite
7+
8+
Run comprehensive development verification checks for the Codu project.
9+
10+
## Current Context
11+
12+
Branch: !`git branch --show-current`
13+
Status: !`git status --short | head -10`
14+
15+
## Task
16+
17+
Run the following verification steps in order:
18+
19+
### 1. Lint Check
20+
Run ESLint and verify there are **0 errors** (warnings are acceptable):
21+
```bash
22+
npm run lint
23+
```
24+
Report the error/warning counts.
25+
26+
### 2. TypeScript Compilation
27+
Verify TypeScript compiles without errors:
28+
```bash
29+
npx tsc --noEmit
30+
```
31+
32+
### 3. Build Check
33+
Verify the Next.js build completes successfully:
34+
```bash
35+
npm run build
36+
```
37+
38+
### 4. E2E Tests (if requested)
39+
If `$ARGUMENTS` includes "e2e", also run E2E tests:
40+
```bash
41+
npm run test:e2e
42+
```
43+
44+
## Output
45+
46+
Provide a clear summary:
47+
- Lint: PASS/FAIL (X errors, Y warnings)
48+
- TypeScript: PASS/FAIL
49+
- Build: PASS/FAIL
50+
- E2E Tests: PASS/FAIL/SKIPPED
51+
52+
If any check fails, provide details and suggest fixes.

app/(app)/articles/_client.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,6 @@ const sortUIToAPI: Record<UISortOption, APISortOption> = {
360360
popular: "top",
361361
};
362362

363-
// Map API sort to UI sort (for URL params)
364-
const sortAPIToUI: Record<APISortOption, UISortOption> = {
365-
newest: "recent",
366-
oldest: "recent", // fallback
367-
top: "popular",
368-
trending: "trending",
369-
};
370-
371363
const validUISorts: UISortOption[] = ["recent", "trending", "popular"];
372364

373365
const ArticlesPage = () => {
@@ -432,8 +424,8 @@ const ArticlesPage = () => {
432424
return (
433425
<>
434426
<div className="mx-2">
435-
<div className="mt-8 flex max-w-5xl items-center justify-between pb-2 sm:mx-auto sm:max-w-2xl lg:max-w-5xl">
436-
<h1 className="text-3xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50 sm:text-4xl">
427+
<div className="mt-2 flex max-w-5xl items-center justify-between sm:mx-auto sm:mt-6 sm:max-w-2xl lg:max-w-5xl">
428+
<h1 className="text-2xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50">
437429
{typeof tag === "string" ? (
438430
<div className="flex items-center justify-center">
439431
<TagIcon className="mr-3 h-6 w-6 text-neutral-800 dark:text-neutral-200" />

app/(app)/feed/_client.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ const FeedPage = () => {
109109
return (
110110
<div className="mx-2">
111111
{/* Header */}
112-
<div className="mt-8 flex max-w-5xl items-center justify-between pb-2 sm:mx-auto sm:max-w-2xl lg:max-w-5xl">
113-
<h1 className="text-3xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50 sm:text-4xl">
112+
<div className="mt-2 flex max-w-5xl items-center justify-between sm:mx-auto sm:mt-6 sm:max-w-2xl lg:max-w-5xl">
113+
<h1 className="hidden text-2xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50 sm:block">
114114
Feed
115115
</h1>
116+
<span />
116117
<FeedFilters
117118
sort={sort}
118119
type={type}

app/(app)/layout.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import { headers } from "next/headers";
2-
import ThemeProvider from "@/components/Theme/ThemeProvider";
3-
import { TRPCReactProvider } from "@/server/trpc/react";
41
import { getServerAuthSession } from "@/server/auth";
5-
import AuthProvider from "@/context/AuthProvider";
6-
import ProgressBar from "@/components/ProgressBar/ProgressBar";
72
import React from "react";
8-
import { PromptProvider } from "@/components/PromptService";
93
import { db } from "@/server/db";
104
import { eq } from "drizzle-orm";
115
import { user } from "@/server/db/schema";

app/(app)/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const Home = async () => {
4141
)}
4242

4343
<div className="mx-2" id={session ? "cta" : ""}>
44-
<div className="mt-6 flex max-w-5xl items-center justify-between pb-2 sm:mx-auto sm:max-w-2xl lg:max-w-5xl">
45-
<h3 className="text-3xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50 sm:text-4xl">
44+
<div className="mt-6 flex max-w-5xl items-center justify-between sm:mx-auto sm:max-w-2xl lg:max-w-5xl">
45+
<h3 className="text-2xl font-bold tracking-tight text-neutral-800 dark:text-neutral-50">
4646
Trending
4747
</h3>
4848
</div>

components/Feed/Filters.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ type Props = {
3535
type?: ContentType;
3636
category?: string | null;
3737
categories: string[];
38-
onSortChange: (sort: SortOption) => void;
39-
onTypeChange?: (type: ContentType) => void;
40-
onCategoryChange: (category: string | null) => void;
38+
onSortChange: (_sort: SortOption) => void;
39+
onTypeChange?: (_type: ContentType) => void;
40+
onCategoryChange: (_category: string | null) => void;
4141
showTypeFilter?: boolean;
4242
};
4343

@@ -80,11 +80,14 @@ const FeedFilters = ({
8080
typeOptions.find((opt) => opt.value === type) || typeOptions[0];
8181

8282
return (
83-
<div className="flex items-center gap-3" data-testid="feed-filters">
83+
<div
84+
className="flex items-center gap-2 sm:gap-3"
85+
data-testid="feed-filters"
86+
>
8487
{/* Content Type Dropdown */}
8588
{showTypeFilter && onTypeChange && (
8689
<Menu as="div" className="relative" data-testid="type-filter">
87-
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700">
90+
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-2 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700 sm:px-3">
8891
<currentType.icon className="h-4 w-4" />
8992
<span>{currentType.label}</span>
9093
<ChevronDownIcon className="h-4 w-4" />
@@ -129,7 +132,7 @@ const FeedFilters = ({
129132

130133
{/* Sort Dropdown */}
131134
<Menu as="div" className="relative" data-testid="sort-filter">
132-
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700">
135+
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-2 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700 sm:px-3">
133136
<currentSort.icon className="h-4 w-4" />
134137
<span>{currentSort.label}</span>
135138
<ChevronDownIcon className="h-4 w-4" />
@@ -174,7 +177,7 @@ const FeedFilters = ({
174177
{/* Category Dropdown */}
175178
{categories.length > 0 && (
176179
<Menu as="div" className="relative" data-testid="topic-filter">
177-
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700">
180+
<MenuButton className="flex items-center gap-1 rounded-lg border border-neutral-300 bg-white px-2 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 dark:border-neutral-600 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700 sm:px-3">
178181
<span>{category || "All Topics"}</span>
179182
<ChevronDownIcon className="h-4 w-4" />
180183
</MenuButton>

components/Header/MinimalHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ export function MinimalHeader({
8787
</Link>
8888
</div>
8989

90-
{/* Mobile: Logo in center */}
91-
<div className="flex flex-1 justify-center lg:hidden">
90+
{/* Mobile: Logo on left */}
91+
<div className="flex lg:hidden">
9292
<Link to="/">
9393
<Image
9494
src="/images/codu.png"

components/UnifiedContentCard/UnifiedContentCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ const UnifiedContentCard = ({
243243
>
244244
{/* Meta info row */}
245245
<div className="mb-1.5 flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-neutral-500 dark:text-neutral-400">
246-
{/* Author/Source info - show author for any content type with author */}
247-
{author ? (
246+
{/* Author/Source info - show author for content with valid author username */}
247+
{author?.username ? (
248248
<Link
249249
href={`/${author.username}`}
250250
className="flex items-center gap-1.5 hover:text-neutral-700 dark:hover:text-neutral-200"
@@ -384,7 +384,7 @@ const UnifiedContentCard = ({
384384
<Link
385385
href={cardUrl}
386386
onClick={type === "LINK" ? handleExternalClick : undefined}
387-
className="relative hidden w-[120px] flex-shrink-0 self-start overflow-hidden rounded-lg sm:block"
387+
className="relative w-[80px] flex-shrink-0 self-start overflow-hidden rounded-lg sm:w-[120px]"
388388
>
389389
<img
390390
src={imageUrl}

0 commit comments

Comments
 (0)