diff --git a/my-blog/static/index.html b/my-blog/static/index.html index 0392639..b4c4618 100644 --- a/my-blog/static/index.html +++ b/my-blog/static/index.html @@ -1,3 +1,3 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/my-blog/templates/oauth-assets.html b/my-blog/templates/oauth-assets.html index 0392639..b4c4618 100644 --- a/my-blog/templates/oauth-assets.html +++ b/my-blog/templates/oauth-assets.html @@ -1,3 +1,3 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/oauth/src/App.css b/oauth/src/App.css index 95bb533..d3c1954 100644 --- a/oauth/src/App.css +++ b/oauth/src/App.css @@ -499,9 +499,8 @@ } .comments-list { - border: 1px solid #ddd; border-radius: 8px; - padding: 20px; + padding: 0px; } .comments-header { @@ -860,28 +859,6 @@ background: #f6f8fa; } -/* AI Chat History */ -.ai-chat-list { - max-width: 100%; - border: 1px solid #ddd; - border-radius: 8px; - padding: 20px; -} - -.chat-item { - border: 1px solid #d1d9e0; - border-radius: 8px; - padding: 16px; - margin-bottom: 16px; - background: #ffffff; -} - -.chat-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 12px; -} .chat-actions { display: flex; diff --git a/oauth/src/App.tsx b/oauth/src/App.tsx index 82334ab..256447c 100644 --- a/oauth/src/App.tsx +++ b/oauth/src/App.tsx @@ -259,8 +259,8 @@ function App() { if (appConfig.rkey) { // On post page: show only chats for this specific post filteredRecords = allChatRecords.filter(record => { - const recordPath = record.value.post?.url ? new URL(record.value.post.url).pathname : ''; - return recordPath === window.location.pathname; + const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop()?.replace(/\.html$/, '') : ''; + return recordRkey === appConfig.rkey; }); } else { // On top page: show latest 3 records from all pages @@ -306,9 +306,8 @@ function App() { const filteredLangRecords = appConfig.rkey ? langRecords.filter(record => { // Compare rkey only (last part of path) - const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop() : ''; - const currentRkey = window.location.pathname.split('/').pop(); - return recordRkey === currentRkey; + const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop()?.replace(/\.html$/, '') : ''; + return recordRkey === appConfig.rkey; }) : langRecords.slice(0, 3); // Top page: latest 3 @@ -325,9 +324,8 @@ function App() { const filteredCommentRecords = appConfig.rkey ? commentRecords.filter(record => { // Compare rkey only (last part of path) - const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop() : ''; - const currentRkey = window.location.pathname.split('/').pop(); - return recordRkey === currentRkey; + const recordRkey = record.value.post?.url ? new URL(record.value.post.url).pathname.split('/').pop()?.replace(/\.html$/, '') : ''; + return recordRkey === appConfig.rkey; }) : commentRecords.slice(0, 3); // Top page: latest 3 @@ -540,16 +538,14 @@ function App() { // ページpathでフィルタリング(指定された場合) - const filteredComments = pageUrl + const filteredComments = pageUrl && appConfig.rkey ? userComments.filter(record => { try { - // Compare path only, not full URL to support localhost vs production - const recordPath = record.value.url ? new URL(record.value.url).pathname : ''; - const currentPath = new URL(pageUrl).pathname; - return recordPath === currentPath; + // Compare rkey only (last part of path) + const recordRkey = record.value.url ? new URL(record.value.url).pathname.split('/').pop() : ''; + return recordRkey === appConfig.rkey; } catch (err) { - // Fallback to exact match if URL parsing fails - return record.value.url === pageUrl; + return false; } }) : userComments; @@ -1053,6 +1049,8 @@ function App() {