feat: add sidebar panel, i18n, token validation, and UX improvements#20
feat: add sidebar panel, i18n, token validation, and UX improvements#20Ebola-Chan-bot wants to merge 2 commits intoAcode-Foundation:mainfrom
Conversation
Ebola-Chan-bot
commented
Mar 1, 2026
- Add sidebar.js: full actionable sidebar panel with 6 GitHub operations (Open Repo, Open Gist, Delete Gist, Delete Gist File, Update Token, Clear Cache)
- Add Chinese/English i18n based on device locale detection (navigator.languages)
- Token handling: normalize input (strip Bearer/token prefix, trim whitespace), validate format, and immediately verify against GitHub /user API on save
- Enhanced API error messages: include GitHub's response message and documentation URL
- Fix stale gh:// filesystem handlers from old plugin instances via global registry pattern (window.acodeGithubFsTests) for proper cleanup across plugin reloads
- Prefetch repos/branches before opening palette to avoid misleading empty results
- Show toast after opening repo folder guiding user to check file browser sidebar
- Pass listFiles:false to openFolder to skip 'list all files may crash' prompt
- Localize all user-facing strings: tutorial, commands, dialogs, toasts, settings
- Update .gitignore to exclude pem files, debug server, and package-lock.json
- Add sidebar.js: full actionable sidebar panel with 6 GitHub operations (Open Repo, Open Gist, Delete Gist, Delete Gist File, Update Token, Clear Cache) - Add Chinese/English i18n based on device locale detection (navigator.languages) - Token handling: normalize input (strip Bearer/token prefix, trim whitespace), validate format, and immediately verify against GitHub /user API on save - Enhanced API error messages: include GitHub's response message and documentation URL - Fix stale gh:// filesystem handlers from old plugin instances via global registry pattern (window.__acodeGithubFsTests__) for proper cleanup across plugin reloads - Prefetch repos/branches before opening palette to avoid misleading empty results - Show toast after opening repo folder guiding user to check file browser sidebar - Pass listFiles:false to openFolder to skip 'list all files may crash' prompt - Localize all user-facing strings: tutorial, commands, dialogs, toasts, settings - Update .gitignore to exclude pem files, debug server, and package-lock.json
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub sidebar panel and expands localization/UX around repository and gist workflows, while also improving token handling and GitHub API error reporting.
Changes:
- Introduces a new sidebar panel (
src/sidebar.js) with buttons for common GitHub operations (repos, gists, token, cache). - Adds Chinese/English localization for many user-facing strings and improves UX (prefetch repos/branches, additional toasts,
openFolder({ listFiles:false })). - Improves token normalization/validation and enhances GitHub API error messages with GitHub-provided details and docs URL.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/sidebar.js |
Adds a sidebar UI with actionable GitHub operations and basic busy/error handling. |
src/main.js |
Integrates sidebar, adds i18n helper, token normalization/validation, caching/UX improvements. |
src/githubFs.js |
Adds a global registry cleanup to remove stale gh:// handlers across reloads and localizes commit prompt strings. |
src/GitHubAPI/Requestable.js |
Normalizes token input and improves Axios error message detail formatting. |
.gitignore |
Ignores additional local/dev artifacts (pem, debug server, package-lock). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds significant UX improvements including a sidebar panel, bilingual i18n (Chinese/English), and robust token handling. The implementation introduces 6 actionable GitHub operations via sidebar, fixes plugin hot-reload issues with a global registry pattern, and validates tokens against the GitHub API. Key Changes:
Issue Found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Clicks Update Token] --> B[Show Token Input Prompt]
B --> C{User Enters Token}
C -->|Cancel| D[Exit]
C -->|Submit| E[Normalize Token]
E --> F[Strip Bearer/token prefix]
F --> G[Trim whitespace]
G --> H{Validate Format}
H -->|Invalid Regex| I[Show Error Toast]
I --> D
H -->|Valid| J[Save to this.token]
J --> K[Reset FS Initialized]
K --> L[Save to localStorage]
L --> M[Init FS]
M --> N[Create GitHub API Client]
N --> O[Call /user API]
O -->|Success| P[Token Valid - Complete]
O -->|Fail| Q[Show Validation Error]
Q --> R[Throw Error]
style L fill:#ffcccc
style O fill:#ccffcc
style Q fill:#ffcccc
Last reviewed commit: 7b8ec0f |
- Requestable: default auth={} to prevent TypeError on unauthenticated use
- main: persist token to localStorage only after validation succeeds, rollback on failure
- main: fix 'Github' casing to 'GitHub' in user-facing strings
- sidebar: remove unused refreshAfter parameter from runAction/createActionButton