Skip to content

refactor(ui): remove debug logs, translate Chinese comments, improve API error logging#17

Merged
Killea merged 1 commit intoKillea:mainfrom
bertheto:refactor/cleanup-inline-js
Mar 1, 2026
Merged

refactor(ui): remove debug logs, translate Chinese comments, improve API error logging#17
Killea merged 1 commit intoKillea:mainfrom
bertheto:refactor/cleanup-inline-js

Conversation

@bertheto
Copy link
Contributor

@bertheto bertheto commented Mar 1, 2026

Summary

Code quality cleanup across the frontend JS modules.

Changes

Remove debug console.log in production paths

src/static/js/shared-chat.js

  • Remove 4 console.log statements left in sendMessage(): payload dump, response dump, metadata dump, mention count

src/static/index.html

  • Remove 7 console.log / console.error statements from �ppendBubble() image rendering path
  • Keep console.warn on metadata JSON parse failure (legitimate diagnostic)

Translate Chinese comments to English

src/static/index.html

  • openThreadContextMenu(): translate comment about storing right-click position
  • getAgentState(): translate 4 inline comments explaining the state machine logic

src/static/js/shared-threads.js

  • Remove 2 Chinese inline comments in context menu highlight/clear logic

src/static/js/components/acb-confirm-dialog.js

  • Translate all 6 Chinese inline comments in _positionDialog()
  • Translate the full JSDoc block on show() from Chinese to English

Improve API error logging

src/static/js/shared-api.js

  • Add console.warn on non-2xx HTTP responses (was silently ignored)
  • Add console.warn on network errors with method + path context (was swallowed to
    ull)

Tests

  • Vitest unit tests: 18/18 passed
  • Python unit tests (pytest): 54/54 passed

… English, improve API error logging

- shared-chat.js: remove 4 debug console.log statements left in production path (sendMessage)
- index.html: remove 7 debug console.log from appendBubble image rendering; keep console.warn on parse failure
- index.html: translate Chinese comments in getAgentState() and openThreadContextMenu() to English
- shared-threads.js: remove 2 Chinese comments in context menu highlight logic
- acb-confirm-dialog.js: translate all Chinese comments and JSDoc to English
- shared-api.js: add HTTP status warning and network error logging (replaces silent null return)
@Killea Killea merged commit cb09d09 into Killea:main Mar 1, 2026
1 check passed
@bertheto bertheto deleted the refactor/cleanup-inline-js branch March 1, 2026 14:57
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