Commit Graph
195 Commits
Author SHA1 Message Date
therainismeandGitHub e9cc98b7ee feat(web): Add session sidebar for desktop, keep mobile single-page layout (#112)
* feat(web): Responsive session sidebar + split chat layout

* Update sidebar width

* Fixed dialog

* Move the sidebar scrollbar to the left without flipping content
2026-01-31 10:06:43 +08:00
Trustin LeeandGitHub 7cad11ca27 Add About section to settings page with version info and tests (#119)
* feat(web): add About section to settings page

- Add website link to hapi.run
- Display app version from CLI package
- Display protocol version from shared module
- Add Vitest testing setup with settings page tests

🤖 Generated with Claude Code

* test(web): add tests for website link and i18n key usage

Address residual risks mentioned in PR review:
- Test website link URL and security attributes (target, rel)
- Verify correct i18n keys are used for About section via spy

Simplify test setup by using real I18nProvider and en locale.

🤖 Generated with Claude Code
2026-01-30 09:48:49 +08:00
weishu 308249abdb fix(web): improve font scale compatibility and defaults 2026-01-29 16:33:30 +08:00
therainismeandweishu efbe4f8d90 feat(web): add font size setting
- Add Settings > Display > Font Size selector (80/90/100/110/120%)
- Persist preference (hapi-font-scale) and apply globally via --app-font-scale
- Normalize main UI typography to match Settings
2026-01-29 16:25:47 +08:00
weishu b7c06db327 refactor: extract agent flavor utility functions into shared module 2026-01-29 15:41:19 +08:00
weishu cdf8226a9d refactor: extract tool input utility functions into shared module
Move getInputString, getInputStringAny, and truncate functions from
individual ToolCard components into a dedicated toolInputUtils module
to eliminate duplication across PermissionFooter, ToolCard, and
knownTools components.
2026-01-29 14:37:06 +08:00
weishu 70b5c22c8f feat: support opencode 2026-01-29 10:34:57 +08:00
J. F. ZhangandGitHub 66ab96bf38 fix(web): allow newline on mobile enter (#116) 2026-01-29 09:00:37 +08:00
weishu aef4da9ea9 docs: update cli, hub, and web README files with new features and configuration
- cli/README.md: Remove non-existent runner commands, add codex resume and worktree config
- hub/README.md: Document auto-generated CLI_API_TOKEN, add session/machines/events endpoints and push notifications
- web/README.md: Add settings and terminal routes, terminal and voice assistant sections
- docs/guide: Fix broken anchor link and add terminal FAQ entry
- AGENTS.md: Add new source directory references
2026-01-27 20:46:39 +08:00
weishu 37e10a831b feat: rename server package to hub
Rename the `server/` directory to `hub/` and update all references
across CLI, docs, web, and workspace configuration.
2026-01-27 19:51:21 +08:00
weishu 87c79c3b94 feat: add session resume capability with automatic continuation
Add ability to resume inactive sessions and automatically continue with new
session ID. Includes message merging for preserving conversation history,
UI improvements to allow sending during inactive state, and database schema
migration. close #87
2026-01-27 14:44:53 +08:00
weishu 7a8f1c3e87 feat: add compact_boundary event support in web UI
https://github.com/tiann/hapi/issues/108#issuecomment-3799439152
2026-01-27 10:04:01 +08:00
weishu 40c232ef8b fix: handle option highlighting in request_user_input component
- Trim selected value to match option labels during comparison
- Parse tool.result as JSON when loaded from history, as it's stored as string
2026-01-26 14:08:35 +08:00
weishu ae9650ca7c feat: add support for Codex's request_user_input tool
Implement full support for the request_user_input tool with both Web UI and CLI
components. This includes:

- New view and footer components for request_user_input tool UI
- Tool registration in knownTools and view registries
- Nested answer format support (Record<string, { answers: string[] }>)
- Backward compatibility with flat answer format (Record<string, string[]>)
- Permission handler updates for CLI request_user_input acceptance
- Type definitions and schema updates across shared/cli/server/web packages
- Translation strings for request_user_input UI elements
- Conditional footer rendering in ToolCard for question tools
2026-01-26 11:58:36 +08:00
weishu 8137ce4f23 feat: add microcompact_boundary event handling in web UI
Adds support for Claude Code's microcompact_boundary system message type to display context microcompaction events with token savings information in the chat UI. Shows a package icon with formatted token count (e.g., "Context compacted (saved 32K tokens)"). close #108
2026-01-26 10:30:27 +08:00
weishu 6f8f44a314 refactor: move attachment metadata schema to shared protocol package 2026-01-23 16:04:37 +08:00
weishu 9922588c6f refactor: consolidate utility functions into shared package
Move duplicate isObject, asString, asNumber, and safeStringify functions from multiple modules into a centralized shared/src/utils.ts module and update imports across cli, server, and web packages. This eliminates code duplication and improves maintainability.
2026-01-23 16:04:37 +08:00
weishu e130dfd24b feat: add model selection for AI agents (claude, codex, gemini)
Add a new ModelSelector component that allows users to choose specific model variants for different AI agents. This includes:
- ModelSelector UI component with agent-specific model options
- Model parameter propagation through API, RPC, and spawning layers
- Support for auto model selection (default behavior)
- Localization strings for English and Chinese
- Type definitions for model options per agent
2026-01-23 11:55:29 +08:00
weishu 29551478cc feat: add image paste functionality to composer
Implements paste event handler that automatically adds pasted images as attachments
to the composer. Adds Windows x64 binary support to dependencies.
2026-01-23 11:42:12 +08:00
weishu 8793362b5f docs: update installation guide and fix environment variable references (#85)
- Replace outdated WEBAPP_URL with HAPI_PUBLIC_URL in server and web READMEs
- Add CLI version verification steps in prerequisites section
- Enhance Cloudflare Tunnel documentation with quick and named tunnel examples
- Add --protocol http2 recommendation for tunnel stability
- Include pm2 alternative for runner process management
- Add Telegram Mini App troubleshooting notes and verification steps
2026-01-21 20:08:10 +08:00
weishu 6a498ec251 feat: redesign voice assistant icon with sound wave visualization 2026-01-21 19:33:59 +08:00
freespace8andGitHub 2cb8727874 feat: expose skills and $ autocomplete (#92) 2026-01-21 16:28:15 +08:00
weishu 26f6249fef fix: reposition ReactQueryDevtools button to middle-right
The button was blocking UI elements at the bottom-right corner. This CSS
override moves it to the middle-right position while keeping the same
horizontal placement, providing better UI visibility and interaction.
2026-01-20 10:28:13 +08:00
weishu 15d550d39a feat: add voice language selection in settings
Add support for users to select voice language preference, which is passed through to ElevenLabs agents via platform settings overrides. Includes new language mapping utilities, UI controls in settings page, and updated voice session initialization.
2026-01-20 00:57:01 +08:00
weishu 7a5946731d feat: add settings page with language dropdown 2026-01-19 21:33:22 +08:00
weishu 8a89d23e1b fix: properly clean up voice session resources on disconnect
- Add resetRealtimeSessionState() function to reset session state
- Store and stop media stream from permission request to prevent resource leak
- Call reset function when voice session disconnects
2026-01-19 19:14:46 +08:00
weishu a928e82db2 Add error hint 2026-01-19 19:03:01 +08:00
weishu 8f5b773b23 feat: voice assistant 2026-01-19 18:16:57 +08:00
weishu 53e4de6684 feat: add file upload support 2026-01-17 19:38:12 +08:00
weishu 940d7b8233 feat(web): add turn-duration event display 2026-01-17 15:00:04 +08:00
4f25fa2da4 feat(web): terminal quick keys + modifiers + long-press (#67)
* feat: expand terminal quick keys

Add navigation keys plus ctrl/alt modifiers for the web terminal.

* feat: make terminal modifiers sticky

Keep Ctrl/Alt active until toggled off, Termux-style.

* style: improve terminal quick key buttons

Boost active contrast and adjust sizing for mobile.

* feat: add terminal key popups

Use long-press popups for / and - keys.

* fix: make terminal modifiers mutually exclusive

* fix(web): keep soft keyboard open on terminal buttons

* fix(web): allow mouse clicks on terminal quick keys

* refactor(web): simplify terminal quick input modifier handling

Remove the applyModifiers callback and inline modifier state application.
Add automatic modifier reset after quick input when appropriate.

* refactor(web): extract dispatchSequence helper for terminal input handling

Create a reusable dispatchSequence callback to handle modifier application
and reset logic for both terminal data input and quick input handlers.

---------

Co-authored-by: weishu <twsxtd@gmail.com>
2026-01-14 11:55:58 +08:00
weishu 7003bda706 fix: use baseUrl for Socket.IO connection to support separate frontend hosting
Previously, useTerminalSocket used a relative path `/terminal` for Socket.IO,
which would connect to the frontend host instead of the actual HAPI server.
Now it uses the baseUrl from context to connect to the correct server, enabling
scenarios like hosting the frontend on GitHub Pages while the server runs elsewhere.
2026-01-14 11:27:35 +08:00
weishu 5d1899616c fix: typecheck 2026-01-14 08:59:55 +08:00
weishu 2449d783f6 refactor: use useNavigate for URL parameter cleanup in AppInner 2026-01-14 08:39:36 +08:00
weishu 716a42e5e0 fix: enable GitHub Pages SPA routing by copying index.html to 404.html
GitHub Pages will serve 404.html when a route is not found, allowing
the React app to load and handle client-side routing for SPA navigation.
2026-01-13 21:52:57 +08:00
weishu 5defb6dbfc feat: add wireguard relay integration for public server access with End-to-End Encryption
Integrates tunwg (WireGuard tunnel) to enable optional public access
to the hapi server. Tunnel is disabled by default and enabled via
--relay flag or HAPI_TUNNEL=true environment variable.

Users can now run 'hapi server --relay' and get a direct link like:
https://app.hapi.run/?server=https://xxx.relay.hapi.run&token=xxx
2026-01-13 20:18:11 +08:00
weishu 251b04ec2d fix: use message field for Codex permission card subtitle
Codex elicitation requests from MCP use the 'message' field (from
ElicitRequest schema), not 'command' or 'cwd'. Update the permission
handler to extract and pass this field, and display it as the card
subtitle with fallback to command.
2026-01-13 11:06:50 +08:00
weishu 41d8844c00 fix: implement permission handler callbacks and add CodexPermission UI support
Adds onRequest and onComplete callbacks to CodexPermissionHandler to track
permission request/response lifecycle. Includes helper functions to normalize
command and cwd inputs, and displays permission requests in the web UI.
2026-01-13 11:06:50 +08:00
weishu a6e35eaf65 fix: add shell_command tool to knownTools registry
Codex API sends 'shell_command' as the tool name for bash commands, but
the web app didn't recognize it, falling back to a generic wrench icon.
This adds proper presentation with a terminal icon, matching Claude's
Bash tool display.
2026-01-13 11:06:50 +08:00
weishu d260ea86f0 fix: parse codex bash output format in web app display
Parse the "Exit code: X\nWall time: Y\nOutput:\n..." format from bash tool
results and display metadata (exit code and wall time) separately from the
output content as a code block.
2026-01-13 11:06:50 +08:00
f6cf2ee49c feat(web): add fuzzy matching for slash commands (#63)
Co-authored-by: Liheng <liheng@example.com>
2026-01-13 11:06:28 +08:00
weishu 8ed94193d8 fix: position session action menu at touch/click point
- Updated useLongPress.ts to pass click coordinates to onLongPress callback
- Modified SessionList.tsx to use menuAnchorPoint state instead of menuAnchorRef
- Updated SessionActionMenu.tsx to position menu based on anchorPoint coordinates
- Enhanced SessionHeader.tsx to calculate anchorPoint from button position and added stopPropagation to fix toggle issue

The menu now appears at the exact touch/click position instead of being centered or aligned to the button edge.
2026-01-12 19:08:01 +08:00
weishu 83664a7fc9 fix: use worktree grouping for homepage project count 2026-01-12 18:35:44 +08:00
J. F. ZhangandGitHub c0502d128c Dispose terminal addons before terminal teardown (#58) 2026-01-11 17:28:19 +08:00
ChenandGitHub aaaad33e61 feat: add i18n support and enhance session UI (#50) 2026-01-10 22:07:22 +08:00
JovinesandGitHub 2fb61940e4 fix: prevent click navigation after long press on session list (#52) 2026-01-10 19:58:20 +08:00
Ruihang XiaandGitHub c0446766a5 feat(ui): change session action menu UI style (#33) 2026-01-08 11:09:42 +08:00
Begonia, HEandGitHub 146cbf8db0 feat(terminal): add Nerd Font support for Powerline themes (#29) 2026-01-08 10:55:03 +08:00
weishu cb69001385 fix: prevent continuous "Load More" triggering in message virtualization
The IntersectionObserver's useEffect had handleLoadMore in its dependency
array, but handleLoadMore depended on isLoadingMoreMessages. When loading
completed, isLoadingMoreMessages changed, causing handleLoadMore to be
recreated and the observer to rebuild, immediately firing again and
triggering continuous load requests.

Fixed by storing handleLoadMore in a ref and removing it from the
IntersectionObserver's dependency array, allowing it to rebuild only when
hasMoreMessages or isLoadingMessages change.
2026-01-08 09:09:53 +08:00
weishu 803c2f65a9 feat: add notification optimization with visibility tracking and toast messages
Implement a visibility-aware notification system that delivers toast messages via SSE to visible browser tabs instead of sending push notifications, reducing unnecessary push requests. Includes VisibilityTracker for monitoring connection visibility, toast UI components, and enhanced SSEManager with toast delivery capability.
2026-01-07 18:58:31 +08:00