feat: initialization - #2
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new NVDA add-on called "AskEase" - an AI-powered screen assistant that helps visually impaired users understand and interact with their screen content. The add-on integrates with OpenAI's API to provide intelligent screen analysis, step-by-step guidance, and an interactive chat interface.
Key Changes:
- Implements core AI screen assistant functionality with vision-based analysis and natural language interaction
- Adds comprehensive build system using SCons with support for internationalization and add-on packaging
- Includes Chinese (Simplified) localization with 339 translated strings
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| site_scons/site_tools/gettexttool/init.py | SCons tool for gettext localization support (msgfmt, xgettext) |
| sconstruct | Main build script for add-on packaging, localization, and documentation generation |
| buildVars.py | Add-on metadata and build configuration |
| manifest.ini.tpl / manifest-translated.ini.tpl | Template files for add-on manifest generation |
| addon/globalPlugins/screenAssistant/init.py | Main plugin entry point with gesture handling and screen recording |
| addon/globalPlugins/screenAssistant/helpDialog.py | AI chat dialog UI with conversation history and settings |
| addon/globalPlugins/screenAssistant/settingsPanel.py | NVDA settings panel for OpenAI API configuration |
| addon/globalPlugins/screenAssistant/openai_service.py | OpenAI API integration and request handling |
| addon/globalPlugins/screenAssistant/addonConfig.py | Configuration management with .env file support |
| addon/globalPlugins/screenAssistant/desktop/* | Desktop state capture and screenshot functionality |
| addon/globalPlugins/screenAssistant/screenReader/* | Screen reader action history tracking |
| addon/globalPlugins/screenAssistant/message/* | Message list management for chat history |
| addon/globalPlugins/screenAssistant/prompt.py | System prompts and prompt templates for AI |
| addon/locale/zh_CN/LC_MESSAGES/nvda.po | Chinese (Simplified) translation file |
| README.md | Comprehensive documentation for users and developers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3bb723e to
4eb13bc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 25 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CSIDL_DESKTOPDIRECTORY = 0x0010 # Desktop folder | ||
| SHGFP_TYPE_CURRENT = 0 | ||
| # logging chat history to desktop | ||
| LOGGING_ENABLED = False | ||
|
|
||
| def get_user_desktop_dir() -> str: | ||
| try: | ||
| buf = ctypes.create_unicode_buffer(wintypes.MAX_PATH) | ||
| ctypes.windll.shell32.SHGetFolderPathW( | ||
| 0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, buf | ||
| ) | ||
| return buf.value |
There was a problem hiding this comment.
The CSIDL_DESKTOPDIRECTORY constant and related Windows API usage is deprecated. Modern code should use FOLDERID constants with SHGetKnownFolderPath instead of CSIDL constants with SHGetFolderPathW. However, this is marked as low severity as the current implementation will still work.
| CSIDL_DESKTOPDIRECTORY = 0x0010 # Desktop folder | |
| SHGFP_TYPE_CURRENT = 0 | |
| # logging chat history to desktop | |
| LOGGING_ENABLED = False | |
| def get_user_desktop_dir() -> str: | |
| try: | |
| buf = ctypes.create_unicode_buffer(wintypes.MAX_PATH) | |
| ctypes.windll.shell32.SHGetFolderPathW( | |
| 0, CSIDL_DESKTOPDIRECTORY, 0, SHGFP_TYPE_CURRENT, buf | |
| ) | |
| return buf.value | |
| # Modern Windows API constants for Desktop folder | |
| FOLDERID_Desktop = ctypes.c_char_p(b"{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}") | |
| # logging chat history to desktop | |
| LOGGING_ENABLED = False | |
| def get_user_desktop_dir() -> str: | |
| try: | |
| # Setup for SHGetKnownFolderPath | |
| from ctypes import POINTER, byref, windll, wintypes | |
| REFKNOWNFOLDERID = ctypes.c_char_p | |
| # SHGetKnownFolderPath prototype: HRESULT SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR *ppszPath) | |
| SHGetKnownFolderPath = windll.shell32.SHGetKnownFolderPath | |
| SHGetKnownFolderPath.argtypes = [REFKNOWNFOLDERID, wintypes.DWORD, wintypes.HANDLE, POINTER(ctypes.c_wchar_p)] | |
| SHGetKnownFolderPath.restype = wintypes.HRESULT | |
| path_ptr = ctypes.c_wchar_p() | |
| result = SHGetKnownFolderPath(FOLDERID_Desktop, 0, 0, byref(path_ptr)) | |
| if result != 0: | |
| raise OSError("SHGetKnownFolderPath failed") | |
| desktop_path = path_ptr.value | |
| # Free the memory allocated for the path | |
| windll.Ole32.CoTaskMemFree(path_ptr) | |
| return desktop_path |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
No description provided.