Skip to content

fix(web): improve sessions sidebar resizing, accessibility, and persistence - #1

Open
yzs981130 wants to merge 26 commits into
mainfrom
codex/make-left-column-width-adjustable
Open

fix(web): improve sessions sidebar resizing, accessibility, and persistence#1
yzs981130 wants to merge 26 commits into
mainfrom
codex/make-left-column-width-adjustable

Conversation

@yzs981130

Copy link
Copy Markdown
Owner

Motivation

  • Ensure user-resized sessions sidebar width is applied reliably and persisted across desktop breakpoints while making the resize handle keyboard-accessible.
  • Remove duplicated width/localStorage update logic to make drag/resize behavior consistent and less error-prone.

Description

  • Added state and refs (sidebarWidth, sidebarWidthRef, isDraggingSidebar) and a keyboard step constant SIDEBAR_KEYBOARD_STEP to manage size and keyboard adjustments.
  • Consolidated width clamping, state update, and localStorage persistence into a single updateSidebarWidth helper and used it for pointer drag, resize-reclamp, and keyboard actions.
  • Replaced the small button drag handle with an accessible role="separator" element that supports ArrowLeft/ArrowRight keyboard resizing, larger hit area (w-2), and focus styling.
  • Applied the user width via a CSS custom property (--sessions-sidebar-width) and ensured the component reclamps on window resize events.

Testing

  • Ran bun install, which failed due to npm registry HTTP 403 errors in this environment, preventing dependency installation.
  • Ran bun run typecheck:web (which runs tsc --noEmit), which failed because vite/client type definitions are unavailable without dependencies.
  • Ran bun run dev:web (starts vite), which failed because the vite binary is not present due to missing dependencies.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Lihengwannafly and others added 26 commits February 25, 2026 16:57
Co-authored-by: Lihengwannafly <Lihengwannafly@users.noreply.github.com>
On iPadOS with a hardware keyboard, `isTouch` is true (via pointer:coarse)
so submitOnEnter is disabled and there's no keyboard-based way to send.

Add Shift+Enter as a send shortcut that works on all platforms without
changing existing behavior — desktop Enter-to-send is preserved.

Closes tiann#175

via [HAPI](https://hapi.run)

Co-authored-by: HAPI <noreply@hapi.run>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded 'claude' string with getDefaultClaudeCodePath() to
ensure the correct Claude Code executable path is resolved, consistent
with claudeLocal.ts. This respects HAPI_CLAUDE_PATH env var and finds
the global claude installation path properly.
Extract platform detection and error reporting logic into reusable functions
to improve testability and reduce code duplication in the binary launcher.
Adds comprehensive test coverage for platform validation and error messages.
…inary launcher

Refactor platform detection and error reporting logic into dedicated,
testable functions. This improves code organization and enables better
error handling for unsupported platforms and missing platform packages.

- Add SUPPORTED_PLATFORMS constant with platform labels
- Extract getPlatformKey() utility function
- Extract isSupportedPlatform() validation function
- Extract reportUnsupportedPlatform() error reporting function
- Extract reportMissingPlatformPackage() error reporting function
- Update main() to use new functions for clearer error handling
Update installation guides to specify the official npm registry
and add a recommendation to use it for global installs, as some
mirrors may not sync platform packages in time.
* feat(cursor): add support for Cursor Agent CLI integration

- Introduced new command `hapi cursor` to start Cursor Agent sessions.
- Added functionality for resuming sessions and managing permission modes.
- Updated documentation to include Cursor Agent usage and installation instructions.
- Enhanced existing codebase to accommodate Cursor as a recognized agent flavor.
- Implemented local and remote session handling for Cursor Agent.

This update expands HAPI's capabilities by integrating support for the Cursor Agent, allowing users to leverage its features alongside existing agents.

* Remove TODO.md file as it is no longer needed following the integration of Cursor Agent CLI support. This cleanup helps streamline project documentation and reflects the completion of the associated tasks.

* feat(cursor): implement remote mode and fix --hapi-starting-mode

- Consume --hapi-starting-mode in cursor command (do not forward to agent)
- Implement cursorRemoteLauncher: spawn agent -p with stream-json, --trust
- Add cursorEventConverter for NDJSON parsing (system/assistant/tool_call/result)
- Multi-turn via --resume session_id
- Update docs: cursor supports both local and remote modes

Made-with: Cursor

* fix: type error

* fix(cursor): address PR review - model UI, sessionId metadata, duplicate flags

- HappyComposer: use isClaudeFlavor for model mode (cursor has no model modes)
- cursorLocalLauncher: call onSessionFound for resume so cursorSessionId in metadata
- cursorCommand: do not forward parsed flags to cursorArgs (avoid duplicates)

Made-with: Cursor
Add project-level slash command discovery with recursive nested command scanning, pass workingDirectory through slash-command handlers, and align hub/web source unions to include project commands.
…tiann#259)

Replace hardcoded English strings with translation function calls
in SpawnSession.tsx and router.tsx. Add newSession.title key for
the NewSessionPage header to match the newSession.* namespace.
…nn#253)

* feat(web): add appearance setting (follow system / dark / light)

Add user-facing appearance preference to the settings page, allowing
users to choose between Follow System, Dark, and Light themes. The
preference is persisted to localStorage and takes priority over
automatic detection in the existing theme pipeline.

* fix(web): update theme on cross-tab appearance change

The storage event handler only updated React state without calling
updateScheme(), leaving data-theme and useTheme subscribers stale.

* fix(web): move cross-tab appearance sync to global initializeTheme

The storage event listener was inside useAppearance(), which is only
mounted on the settings page. Other pages never received cross-tab
theme updates. Move the listener into initializeTheme() so all pages
respond to appearance changes from other tabs.
@tiann
tiann force-pushed the codex/make-left-column-width-adjustable branch from e3cbda7 to 7050c9b Compare March 8, 2026 03:23
@vercel

vercel Bot commented Mar 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hapi-web Error Error Mar 8, 2026 3:24am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants