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
22 changes: 22 additions & 0 deletions .github/workflows/vercel-auto-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Vercel Auto Deploy

on:
push:
branches:
- dev # 自动预览部署的分支
# 如需对 master/main 做生产部署,可在后续扩展

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy to Vercel (preview)
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Vercel 访问令牌
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} # Vercel 组织 ID
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}# Vercel 项目 ID
vercel-args: '--previews' # dev 分支走预览部署
23 changes: 13 additions & 10 deletions web/src/components/research/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { KeyboardEvent, useRef, useState } from "react"
import { Brain, CalendarRange, Check, Loader2, Search } from "lucide-react"

import { cn } from "@/lib/utils"
import { showTrackMemoryButton } from "@/config/features"
import { Button } from "@/components/ui/button"
import { Textarea } from "@/components/ui/textarea"
import { Popover, PopoverContent, PopoverAnchor } from "@/components/ui/popover"
Expand Down Expand Up @@ -247,16 +248,18 @@ export function SearchBox({

{/* Right side - Memory, Track selector and Search button */}
<div className="flex items-center gap-1.5 sm:gap-2">
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={onOpenMemory}
disabled={disabled || isSearching}
title="Track Memory"
>
<Brain className="h-4 w-4" />
</Button>
{onOpenMemory && showTrackMemoryButton() && (
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={onOpenMemory}
disabled={disabled || isSearching}
title="Track Memory"
>
<Brain className="h-4 w-4" />
</Button>
)}

<TrackSelector
tracks={tracks}
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/research/TrackPills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export function TrackPills({
? "bg-primary text-primary-foreground shadow-sm"
: "bg-background hover:bg-accent"
)}
onClick={() => onSelectTrack(track.id)}
onClick={() => {
if (track.id !== activeTrackId) onSelectTrack(track.id)
}}
disabled={disabled}
>
{(() => {
Expand Down
6 changes: 5 additions & 1 deletion web/src/components/research/TrackSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export function TrackSelector({
tracks.map((track) => (
<DropdownMenuItem
key={track.id}
onClick={() => onSelectTrack(track.id)}
onClick={() => {
if (!activeTrack || track.id !== activeTrack.id) {
onSelectTrack(track.id)
}
}}
className="flex items-center justify-between"
>
<span className="truncate">{track.name}</span>
Expand Down
17 changes: 17 additions & 0 deletions web/src/config/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ export function showDiscoveryLink(): boolean {
return parseBool(process.env.NEXT_PUBLIC_SHOW_DISCOVERY)
}



// Whether to show the Track Memory button (brain icon) in Research search box.
// Default: false. Can be overridden by:
// - runtime localStorage key: paperbot.showTrackMemory ("1"/"true")
// - build-time env: NEXT_PUBLIC_SHOW_TRACK_MEMORY ("1"/"true")
export function showTrackMemoryButton(): boolean {
if (typeof window !== "undefined") {
const v = window.localStorage.getItem("paperbot.showTrackMemory")
if (v != null) return parseBool(v)
}
// Fallback: allow sharing the same env flag as discovery if desired
return (
parseBool(process.env.NEXT_PUBLIC_SHOW_TRACK_MEMORY) ||
parseBool(process.env.NEXT_PUBLIC_SHOW_DISCOVERY)
)
}
Loading