3 Commits

Author SHA1 Message Date
ae8c7392b5 fix oauth-ai-chat 2025-07-17 19:18:54 +09:00
67bb6e0028 fix blog post 2025-07-17 17:24:14 +09:00
75cdd241d2 fix blog post 2025-07-17 17:16:57 +09:00
2 changed files with 6 additions and 24 deletions

View File

@@ -22,18 +22,9 @@ export default function App() {
const [showAskAI, setShowAskAI] = useState(false) const [showAskAI, setShowAskAI] = useState(false)
const [showTestUI, setShowTestUI] = useState(false) const [showTestUI, setShowTestUI] = useState(false)
// Check if current page has matching chat records (AI posts always have chat records) // Simple detection: if the URL contains a date+hash pattern, it's likely an AI post
const isAiPost = !pageContext.isTopPage && Array.isArray(adminChatRecords) && adminChatRecords.some(chatPair => { const isAiPost = !pageContext.isTopPage && pageContext.rkey &&
const recordUrl = chatPair.question?.value?.post?.url /^\d{4}-\d{2}-\d{2}-[a-f0-9]{8}$/.test(pageContext.rkey)
if (!recordUrl) return false
try {
const recordRkey = new URL(recordUrl).pathname.split('/').pop()?.replace(/\.html$/, '')
return recordRkey === pageContext.rkey
} catch {
return false
}
})
// Environment-based feature flags // Environment-based feature flags
const ENABLE_TEST_UI = import.meta.env.VITE_ENABLE_TEST_UI === 'true' const ENABLE_TEST_UI = import.meta.env.VITE_ENABLE_TEST_UI === 'true'

View File

@@ -6,18 +6,9 @@ import LoadingSkeleton from './LoadingSkeleton.jsx'
import { logger } from '../utils/logger.js' import { logger } from '../utils/logger.js'
export default function RecordTabs({ langRecords, commentRecords, userComments, chatRecords, chatHasMore, onLoadMoreChat, userChatRecords, userChatLoading, baseRecords, apiConfig, pageContext, user = null, agent = null, onRecordDeleted = null }) { export default function RecordTabs({ langRecords, commentRecords, userComments, chatRecords, chatHasMore, onLoadMoreChat, userChatRecords, userChatLoading, baseRecords, apiConfig, pageContext, user = null, agent = null, onRecordDeleted = null }) {
// Check if current page has matching chat records (AI posts always have chat records) // Simple detection: if the URL contains a date+hash pattern, it's likely an AI post
const isAiPost = !pageContext.isTopPage && Array.isArray(chatRecords) && chatRecords.some(chatPair => { const isAiPost = !pageContext.isTopPage && pageContext.rkey &&
const recordUrl = chatPair.question?.value?.post?.url /^\d{4}-\d{2}-\d{2}-[a-f0-9]{8}$/.test(pageContext.rkey)
if (!recordUrl) return false
try {
const recordRkey = new URL(recordUrl).pathname.split('/').pop()?.replace(/\.html$/, '')
return recordRkey === pageContext.rkey
} catch {
return false
}
})
const [activeTab, setActiveTab] = useState(isAiPost ? 'collection' : 'profiles') const [activeTab, setActiveTab] = useState(isAiPost ? 'collection' : 'profiles')