Skip to content

feat: chatbot#483

Merged
2paperstar merged 5 commits into
mainfrom
paperstar/zgf-51-chatbot
Feb 28, 2026
Merged

feat: chatbot#483
2paperstar merged 5 commits into
mainfrom
paperstar/zgf-51-chatbot

Conversation

@2paperstar

@2paperstar 2paperstar commented Feb 28, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

변경 사항

  • 새로운 기능

    • 채팅봇 위젯이 애플리케이션에 추가되어 맞춤 아이콘, 색상 및 메시지 스타일을 사용할 수 있습니다.
    • 채팅봇 키를 위한 환경변수가 새로 추가되었습니다.
  • 배포

    • 프로덕션 배포 파이프라인이 추가되어 릴리스 시 자동 배포가 실행됩니다.
  • 수정

    • 개발 도구 위치가 화면 왼쪽 하단으로 변경되었습니다.

@2paperstar
2paperstar requested a review from no-ikjun February 28, 2026 10:51
@coderabbitai

coderabbitai Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbe8b2a and fa248af.

📒 Files selected for processing (1)
  • .github/workflows/production.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/production.yml

📝 Walkthrough

Walkthrough

환경 변수와 외부 챗봇 로더 스크립트를 추가하고, 출시 기반 Cloudflare Pages 배포 워크플로우를 새로 추가했으며, 개발자 도구 위치를 오른쪽에서 왼쪽으로 변경했습니다.

Changes

Cohort / File(s) Summary
환경 설정
.env.example
VITE_CHATBOT_WIDGET_KEY 환경 변수 추가 및 기존 VITE_API_BASE_URL 라인 재정의(값 동일).
CI/CD 파이프라인
.github/workflows/production.yml
릴리스 이벤트 트리거의 프로덕션 배포 워크플로우 신규 추가(빌드 및 Cloudflare Pages 배포 단계 포함).
챗봇 통합
index.html
외부 챗봇 로더 스크립트(https://chatbot.gistory.me/loader.js) 추가 및 위젯 구성용 data- 속성 삽입.
UI 조정
src/routes/__root.tsx
TanStack Devtools 위치를 bottom-right에서 bottom-left로 변경.

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant Loader as "Chatbot Loader (external)"
    participant WidgetSvc as "Chatbot Service / Widget"

    Browser->>Loader: load https://chatbot.gistory.me/loader.js\n(with data-widget-key, colors, icons)
    Loader->>WidgetSvc: initialize widget (widgetKey, config)
    WidgetSvc-->>Loader: widget scripts/resources
    Loader-->>Browser: render widget UI / attach to page
    Browser->>WidgetSvc: user messages (via widget)
    WidgetSvc-->>Browser: bot responses
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rhseung

Poem

🐇 새로 깔린 키와 스크립트로 달려가네,
페이지에 속삭이는 작은 위젯 친구,
릴리스에 맞춰 하늘로 떠나는 배포,
개발자 도구는 왼쪽 구석에서 깜빡깜빡,
토끼가 축하하네 — 모두 잘했어요! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: chatbot' accurately reflects the main changes: adding chatbot widget integration across multiple files (.env.example, index.html, production workflow, and route configuration).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch paperstar/zgf-51-chatbot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Feb 28, 2026

Copy link
Copy Markdown

Deploying ziggle-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa248af
Status: ✅  Deploy successful!
Preview URL: https://b861e0da.ziggle-fe.pages.dev
Branch Preview URL: https://paperstar-zgf-51-chatbot.ziggle-fe.pages.dev

View logs

@no-ikjun no-ikjun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
.github/workflows/production.yml (1)

8-9: Job 이름이 실제 목적과 일치하지 않습니다.

preview-deploy라는 이름은 프로덕션 배포 워크플로우에 적합하지 않습니다. production-deploy와 같이 명확한 이름으로 변경하는 것을 권장합니다.

♻️ 제안된 수정
 jobs:
-  preview-deploy:
+  production-deploy:
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/production.yml around lines 8 - 9, Rename the workflow job
id "preview-deploy" to a name that matches its purpose (e.g.,
"production-deploy") so the job name reflects this is a production deployment;
update every reference to the job id in the workflow file (job declaration
"preview-deploy" and any uses like needs:, if present) to the new
"production-deploy" identifier to keep the workflow consistent.
.env.example (1)

6-7: 정적 분석 도구의 린트 경고를 수정하세요.

dotenv-linter가 다음 문제를 감지했습니다:

  • 환경 변수 키가 알파벳 순서로 정렬되어 있지 않음
  • 파일 끝에 빈 줄이 없음
♻️ 제안된 수정
 VITE_AMPLITUDE_API_KEY=
+VITE_API_BASE_URL=https://api.stg.ziggle.gistory.me
+VITE_CHATBOT_WIDGET_KEY=
 VITE_IDP_CLIENT_ID=
 VITE_IDP_AUTHORIZE_URL=
 VITE_IDP_TOKEN_URL=
 VITE_IDP_REDIRECT_URI=
-VITE_API_BASE_URL=https://api.stg.ziggle.gistory.me
-VITE_CHATBOT_WIDGET_KEY=
+
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.example around lines 6 - 7, Sort the environment variable keys
alphabetically and ensure the file ends with a newline: reorder the two entries
so VITE_API_BASE_URL and VITE_CHATBOT_WIDGET_KEY appear in alphabetical order
(VITE_API_BASE_URL after VITE_CHATBOT_WIDGET_KEY if needed) and add a single
trailing newline at the end of the .env.example file; update the lines that
define VITE_API_BASE_URL and VITE_CHATBOT_WIDGET_KEY accordingly so
dotenv-linter warnings are resolved.
index.html (1)

12-13: 외부 스크립트에 대한 보안 강화를 고려하세요.

외부 도메인(chatbot.gistory.me)에서 스크립트를 로드하고 있습니다. Subresource Integrity(SRI)를 추가하면 스크립트가 변조되었을 때 브라우저가 실행을 차단하여 보안을 강화할 수 있습니다.

<script
  src="https://chatbot.gistory.me/loader.js"
  integrity="sha384-{hash}"
  crossorigin="anonymous"
  ...
></script>

단, 외부 스크립트가 자주 업데이트되는 경우 SRI 해시 관리가 번거로울 수 있으므로 상황에 맞게 판단하세요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@index.html` around lines 12 - 13, The external script tag loading
"https://chatbot.gistory.me/loader.js" should include Subresource Integrity and
crossorigin attributes to prevent executing tampered content; compute the SRI
hash for loader.js and add integrity="sha384-..." plus crossorigin="anonymous"
to the <script src="https://chatbot.gistory.me/loader.js"> element (or
alternatively host a pinned copy or use a CSP nonce if the file changes
frequently), and ensure you update the integrity value whenever the remote
script is updated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/production.yml:
- Around line 17-22: The production build step is missing required VITE_*
environment variables used/validated by getRequiredEnv in src/app.tsx and
referenced in index.html; update the build job (the "build" step) to export the
necessary GitHub Actions secrets as environment variables — at minimum add
VITE_IDP_* (all IDP-related VITE_IDP_* keys used by getRequiredEnv),
VITE_API_BASE_URL, and VITE_CHATBOT_WIDGET_KEY — so bun run build runs with
those secrets available (use secrets.<NAME> for each env var).
- Around line 23-24: The "Deploy to production" step currently uses the
deprecated action `uses: cloudflare/pages-action@v1.5.0`; change this to use the
supported `cloudflare/wrangler-action` (e.g., `uses:
cloudflare/wrangler-action@v1`) and update the step inputs to match
wrangler-action's required inputs (auth token, account/zone/project config, and
any env or args), ensuring any Pages-specific parameters are translated to the
wrangler equivalents in that step.

In `@index.html`:
- Around line 12-19: index.html injects the chatbot loader using the placeholder
%VITE_CHATBOT_WIDGET_KEY% (script tag attributes), but the production build job
doesn't pass VITE_CHATBOT_WIDGET_KEY into the build environment; update the CI
build step to add the VITE_CHATBOT_WIDGET_KEY environment variable and set it
from the repository secret named VITE_CHATBOT_WIDGET_KEY so the placeholder is
replaced at build time and the loader script receives the real widget key.

---

Nitpick comments:
In @.env.example:
- Around line 6-7: Sort the environment variable keys alphabetically and ensure
the file ends with a newline: reorder the two entries so VITE_API_BASE_URL and
VITE_CHATBOT_WIDGET_KEY appear in alphabetical order (VITE_API_BASE_URL after
VITE_CHATBOT_WIDGET_KEY if needed) and add a single trailing newline at the end
of the .env.example file; update the lines that define VITE_API_BASE_URL and
VITE_CHATBOT_WIDGET_KEY accordingly so dotenv-linter warnings are resolved.

In @.github/workflows/production.yml:
- Around line 8-9: Rename the workflow job id "preview-deploy" to a name that
matches its purpose (e.g., "production-deploy") so the job name reflects this is
a production deployment; update every reference to the job id in the workflow
file (job declaration "preview-deploy" and any uses like needs:, if present) to
the new "production-deploy" identifier to keep the workflow consistent.

In `@index.html`:
- Around line 12-13: The external script tag loading
"https://chatbot.gistory.me/loader.js" should include Subresource Integrity and
crossorigin attributes to prevent executing tampered content; compute the SRI
hash for loader.js and add integrity="sha384-..." plus crossorigin="anonymous"
to the <script src="https://chatbot.gistory.me/loader.js"> element (or
alternatively host a pinned copy or use a CSP nonce if the file changes
frequently), and ensure you update the integrity value whenever the remote
script is updated.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59e8f50 and fbe8b2a.

📒 Files selected for processing (4)
  • .env.example
  • .github/workflows/production.yml
  • index.html
  • src/routes/__root.tsx

Comment thread .github/workflows/production.yml
Comment thread .github/workflows/production.yml Outdated
Comment thread index.html
@2paperstar
2paperstar merged commit 82e1510 into main Feb 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants