Skip to content

Commit 7232cdb

Browse files
author
pengyu
committed
modify the preview
1 parent af2adb5 commit 7232cdb

File tree

4 files changed

+7
-78
lines changed

4 files changed

+7
-78
lines changed

frontend/src/app/api/media/[...path]/route.ts

Lines changed: 0 additions & 73 deletions
This file was deleted.

frontend/src/app/media/[...path]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import path from 'path';
44
import { getMediaDir } from 'codefox-common';
55
import { logger } from '@/app/log/logger';
66

7+
78
export async function GET(
89
request: NextRequest,
910
{ params }: { params: { path: string[] } }
@@ -14,7 +15,7 @@ export async function GET(
1415
const filePath = path.join(mediaDir, ...params.path);
1516
const normalizedPath = path.normalize(filePath);
1617
logger.info(`📁 getMediaDir = ${mediaDir}`);
17-
logger.info(`📂 full filePath = ${filePath}`);
18+
logger.info(`📂 full filePath = ${filePath}`);
1819
logger.debug(`Requested path: ${params.path.join('/')}`);
1920
logger.debug(`Full resolved path: ${filePath}`);
2021

frontend/src/components/root/expand-card.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { URL_PROTOCOL_PREFIX } from '@/utils/const';
99
import { logger } from '@/app/log/logger';
1010
import { Button } from '@/components/ui/button';
1111

12-
export function ExpandableCard({ projects, isGenerating = false, onOpenChat }) {
12+
export function ExpandableCard({ projects, isGenerating = false, onOpenChat, isCommunityProject = false }) {
1313
const [active, setActive] = useState(null);
1414
const [iframeUrl, setIframeUrl] = useState('');
1515
const ref = useRef<HTMLDivElement>(null);
@@ -33,9 +33,10 @@ export function ExpandableCard({ projects, isGenerating = false, onOpenChat }) {
3333
}, [active]);
3434

3535
const handleCardClick = async (project) => {
36-
if (onOpenChat) {
36+
if (isCommunityProject) {
37+
setActive(project);
38+
} else if (onOpenChat) {
3739
onOpenChat();
38-
return;
3940
}
4041
};
4142

@@ -170,7 +171,6 @@ export function ExpandableCard({ projects, isGenerating = false, onOpenChat }) {
170171
className="font-medium text-gray-900 dark:text-gray-100 flex items-center text-sm truncate"
171172
>
172173
{project.name}
173-
174174
</motion.h3>
175175
<motion.div
176176
layoutId={`meta-${project.id}`}

frontend/src/components/root/projects-section.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export function ProjectsSection() {
210210
projects={[project]}
211211
isGenerating={!project.isReady}
212212
onOpenChat={() => handleOpenChat(project.id)}
213+
isCommunityProject={view === 'community'}
213214
/>
214215
))}
215216
</div>

0 commit comments

Comments
 (0)