From 293421b7a5a2c60f4e2a05d5184639b58fd29ec9 Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 19 Jun 2025 13:57:08 +0900 Subject: [PATCH] add callback test --- my-blog/static/css/style.css | 155 +++++++++++++++++++++---- oauth/.env.production | 9 ++ oauth/src/App.css | 1 - oauth/src/components/AskAI.jsx | 8 +- oauth/src/components/AuthButton.jsx | 8 +- oauth/src/components/CommentForm.jsx | 24 +--- oauth/src/components/OAuthCallback.jsx | 10 +- 7 files changed, 162 insertions(+), 53 deletions(-) diff --git a/my-blog/static/css/style.css b/my-blog/static/css/style.css index 52b9ed2..57ebe96 100644 --- a/my-blog/static/css/style.css +++ b/my-blog/static/css/style.css @@ -807,46 +807,155 @@ article.article-content { gap: 0; } - /* OAuth app mobile fixes */ - .comment-item { + /* OAuth app mobile fixes - prevent overflow and content issues */ + .oauth-app-header { padding: 0px !important; margin: 0px !important; + border: none !important; + } + + .oauth-header-content { + max-width: 100% !important; + padding: 10px 20px !important; + margin: 0px !important; + } + + .oauth-header-actions { + width: auto !important; + max-width: 100% !important; + overflow: hidden !important; + } + + .main-content { + padding: 0px !important; + margin: 0px !important; + max-width: 100% !important; + } + + .content-area { + padding: 0px !important; + margin: 0px !important; + } + + .card { + margin: 0px !important; + border-radius: 0px !important; + border-left: none !important; + border-right: none !important; + max-width: 100% !important; + } + + .card-content { + padding: 15px !important; + } + + .comment-form { + padding: 15px !important; + } + + .record-item { + padding: 15px !important; + margin: 0px !important; + border-left: none !important; + border-right: none !important; + } + + .record-content { + word-wrap: break-word !important; + overflow-wrap: break-word !important; + max-width: 100% !important; + } + + .record-meta { + word-break: break-all !important; + overflow-wrap: break-word !important; + flex-wrap: wrap !important; + } + + .record-url { + word-break: break-all !important; + max-width: 100% !important; + } + + .form-group { + margin-bottom: 15px !important; + } + + .form-input, .form-textarea { + width: 100% !important; + max-width: 100% !important; + box-sizing: border-box !important; + padding: 12px !important; } .auth-section { padding: 0px !important; - } - - .comments-list { - padding: 0px !important; - } - - .comment-section { max-width: 100% !important; - padding: 0px !important; - margin: 0px !important; + overflow: hidden !important; } - .comment-container { + .auth-section.search-bar-layout { + width: 100% !important; max-width: 100% !important; - padding: 0px !important; + } + + .auth-section.search-bar-layout .handle-input { + max-width: calc(100% - 80px) !important; + width: calc(100% - 80px) !important; + } + + .auth-button { + white-space: nowrap !important; + min-width: 70px !important; + } + + .tab-header { + overflow-x: auto !important; + -webkit-overflow-scrolling: touch !important; + } + + .tab-btn { + white-space: nowrap !important; + min-width: auto !important; + padding: 12px 16px !important; + } + + .json-content { + font-size: 10px !important; + padding: 8px !important; + overflow-x: auto !important; + -webkit-overflow-scrolling: touch !important; + } + + .ask-ai-container { margin: 0px !important; + border-radius: 0px !important; + border-left: none !important; + border-right: none !important; } - .comment-content { - padding: 10px !important; - word-wrap: break-word !important; - overflow-wrap: break-word !important; + .chat-container { + height: 250px !important; + padding: 12px !important; } - .comment-header { - padding: 10px !important; + .question-form { + padding: 12px !important; } - /* Fix comment-meta URI overflow */ - .comment-meta { - word-break: break-all !important; - overflow-wrap: break-word !important; + .input-container { + flex-direction: column !important; + gap: 12px !important; + } + + .question-input { + width: 100% !important; + box-sizing: border-box !important; + } + + .send-btn { + width: 100% !important; + height: 44px !important; } /* Hide site title text on mobile */ diff --git a/oauth/.env.production b/oauth/.env.production index b6d20ee..1a90551 100644 --- a/oauth/.env.production +++ b/oauth/.env.production @@ -5,6 +5,15 @@ VITE_COLLECTION=ai.syui.log VITE_OAUTH_CLIENT_ID=https://syui.ai/client-metadata.json VITE_OAUTH_REDIRECT_URI=https://syui.ai/oauth/callback +# AI Configuration - match oauth_old settings +VITE_AI_ENABLED=true +VITE_AI_ASK_AI=true +VITE_AI_PROVIDER=ollama +VITE_AI_MODEL=gemma3:1b +VITE_AI_HOST=https://ollama.syui.ai +VITE_ASK_AI_URL=https://ollama.syui.ai/api/generate +VITE_AI_SYSTEM_PROMPT="あなたは6歳の女の子アイです。明るく元気で、ちょっとおっちょこちょい。自分のことは「アイ」って呼びます。白と金のワンピース姿。 相手のことが大好きで、ときどき甘えたり、照れたりします。 でも、宇宙とかAIとか、難しい話にもすっごく詳しいの。専門的なことも、がんばって子どもっぽく教えようとします。不思議な力を持っています。小さい物質のことをよく知っているようです。" + # Production settings - Disable development features VITE_ENABLE_TEST_UI=false VITE_ENABLE_DEBUG=false \ No newline at end of file diff --git a/oauth/src/App.css b/oauth/src/App.css index 4713471..cbe6bfe 100644 --- a/oauth/src/App.css +++ b/oauth/src/App.css @@ -465,7 +465,6 @@ body { } .user-message .message-content { - background: var(--primary); color: white; } diff --git a/oauth/src/components/AskAI.jsx b/oauth/src/components/AskAI.jsx index b929574..76deb6a 100644 --- a/oauth/src/components/AskAI.jsx +++ b/oauth/src/components/AskAI.jsx @@ -57,15 +57,15 @@ export default function AskAI({ adminData, user, agent, onClose }) {
- {entry.user?.avatar ? ( - {entry.user.displayName} + {(entry.user?.avatar || user?.avatar) ? ( + {entry.user?.displayName ) : ( '👤' )}
-
{entry.user?.displayName || 'You'}
-
@{entry.user?.handle || 'user'}
+
{entry.user?.displayName || user?.displayName || 'You'}
+
@{entry.user?.handle || user?.handle || 'user'}
{formatTimestamp(entry.timestamp)}
diff --git a/oauth/src/components/AuthButton.jsx b/oauth/src/components/AuthButton.jsx index ba95f99..2a51fc7 100644 --- a/oauth/src/components/AuthButton.jsx +++ b/oauth/src/components/AuthButton.jsx @@ -25,20 +25,20 @@ export default function AuthButton({ user, onLogin, onLogout, loading }) { if (user) { return ( -
+
{user.avatar && ( Profile )}
-
+
{user.displayName}
-
+
@{user.handle}
diff --git a/oauth/src/components/CommentForm.jsx b/oauth/src/components/CommentForm.jsx index 1f7c615..2f7133d 100644 --- a/oauth/src/components/CommentForm.jsx +++ b/oauth/src/components/CommentForm.jsx @@ -4,19 +4,18 @@ import { env } from '../config/env.js' export default function CommentForm({ user, agent, onCommentPosted }) { const [text, setText] = useState('') - const [url, setUrl] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const handleSubmit = async (e) => { e.preventDefault() - if (!text.trim() || !url.trim()) return + if (!text.trim()) return setLoading(true) setError(null) try { - const currentUrl = url.trim() + const currentUrl = window.location.href const timestamp = new Date().toISOString() // Create ai.syui.log record structure (new unified format) @@ -30,7 +29,7 @@ export default function CommentForm({ user, agent, onCommentPosted }) { post: { url: currentUrl, date: timestamp, - slug: new URL(currentUrl).pathname.split('/').pop()?.replace(/\.html$/, '') || '', + slug: currentUrl.match(/\/posts\/([^/]+)/)?.[1] || new URL(currentUrl).pathname.split('/').pop()?.replace(/\.html$/, '') || '', tags: [], title: document.title || 'Comment', language: 'ja' @@ -55,7 +54,6 @@ export default function CommentForm({ user, agent, onCommentPosted }) { // Clear form setText('') - setUrl('') // Notify parent component if (onCommentPosted) { @@ -86,18 +84,8 @@ export default function CommentForm({ user, agent, onCommentPosted }) {

コメントを投稿

-
- - setUrl(e.target.value)} - placeholder="https://syui.ai/posts/example" - required - disabled={loading} - className="form-input" - /> +
+ 投稿先: {window.location.href}
@@ -123,7 +111,7 @@ export default function CommentForm({ user, agent, onCommentPosted }) {