Skip to content

Improve compact mobile UI controls#564

Merged
shantur merged 7 commits into
devfrom
more-ui-improvements
Jun 19, 2026
Merged

Improve compact mobile UI controls#564
shantur merged 7 commits into
devfrom
more-ui-improvements

Conversation

@shantur

@shantur shantur commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Refine narrow session header controls, including overflow menu placement and centered command/context controls.
  • Autosize the narrow prompt input while preserving desktop/hybrid behavior and avoiding mobile keyboard refocus flicker.
  • Improve tab bar behavior at small widths by preventing action button shrink and disabling drag-reorder on touch-only devices.
  • Includes earlier branch changes for message scroll control collapse and square-corner styling documentation.

Validation

  • npm run typecheck --workspace @codenomad/ui

shantur added 7 commits June 19, 2026 10:53
Add an explicit AGENTS.md styling guideline that prevents agents from introducing rounded corners in UI changes unless the user asks for that specific exception.

This keeps future UI work aligned with the project's square-corner visual direction and avoids regressions from default border-radius patterns in component styling.
Replace the always-visible message stream scroll button stack with a compact ArrowUpDown trigger that expands on hover or pointer interaction. This reduces overlap with message item controls while keeping hold, scroll-to-top, and scroll-to-bottom actions available from the same floating control area.

Use pointer-up handlers for both opening the flyout and activating expanded controls so touch interactions do not accidentally trigger newly revealed buttons during the same press sequence. Touch and pen actions explicitly close the pinned-open state, while mouse hover can continue showing the expanded controls until the pointer leaves.

Add a localized label for the collapsed trigger across existing locales and nudge the floating control anchor slightly left/up within safe-area bounds.

Validation: npm run typecheck --workspace @codenomad/ui
Use the measured session center width to drive the narrow header layout instead of relying on phone layout alone. Move search and preview into the existing overflow menu when the center column is narrow, keep the command palette and connection status aligned in the top row, and place secondary actions on the second row.

Add an opt-in ContextMeter layout that centers the used/available token pill with a balanced context indicator spacer, avoiding brittle negative margins. The compact header enables this centered-value mode so the token values remain visually centered while menu and fullscreen controls sit at the row edges.

Validated with npm run typecheck --workspace @codenomad/ui.
Make the prompt input reduce its empty height only when the measured session center column is narrow and the prompt is in compact layout. The textarea now auto-grows from a smaller rows baseline up to the existing compact height cap before scrolling, and the behavior clears when the center column expands out of narrow mode or the prompt leaves compact layout.

Keep the inline expand and clear controls visible through CSS-defined control-fit min-height instead of runtime control measurement. Manual resize and expanded prompt states continue to take precedence over autosizing.

Validated with npm run typecheck --workspace @codenomad/ui.
Skip the automatic post-send textarea refocus on touch-only devices so mobile keyboards do not close and immediately reopen after sending a prompt. Desktop and hybrid devices with a fine pointer keep the existing refocus workflow.

The guard uses pointer media queries to distinguish touch-only devices from laptops or tablets with mouse/trackpad input. Validation: npm run typecheck --workspace @codenomad/ui.
Keep shared tab action buttons at their intended 32px footprint in the flex tab strip by disabling flex shrink on the new-tab-button class. This keeps the new instance and settings controls consistent with notification and remote controls at narrow widths.

Validated with npm run typecheck --workspace @codenomad/ui.
Render static app tabs instead of sortable drag targets on touch-only devices so horizontal swiping the tab bar is not confused with drag-reorder gestures. Desktop and hybrid devices with a fine pointer keep the existing drag-reorder behavior.

The tab scroll container now explicitly opts into horizontal touch panning with momentum scrolling. Validation: npm run typecheck --workspace @codenomad/ui.
@shantur

shantur commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

@CodeNomadBot

I want you to perform the gatekeeper checks for latest PR state

check for regressions
check for better possible implementations
Be the PR gatekeeper
Be ruthless about code quality

@codenomadbot

codenomadbot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Gatekeeper review for latest PR state complete.

Verdict: Request changes before merge.

Findings:

  1. Blocking: collapsed scroll controls are no longer keyboard-operable.
    packages/ui/src/components/message-section.tsx:1432, 1444, 1463, 1475
    The PR converts the scroll-control trigger and actions from click handlers to onPointerUp only. Native <button> keyboard activation dispatches click, not pointerup, so keyboard users can focus these buttons but Enter/Space will not open the menu, toggle long-reply hold, scroll to top, or scroll to bottom. This is a functional accessibility regression from the previous onClick implementation.

    Better implementation: keep pointer-specific suppression/open-close logic if needed, but make activation flow through onClick for every button. If duplicate touch/mouse behavior is the concern, gate the pointer handler to only manage visual state and let onClick run the action, or share a single activateScrollControlAction() called from onClick with separate pointer metadata captured only for hover suppression.

  2. Non-blocking risk: the changed UI behavior lives in very large components.
    Touched files over the repo warning threshold:
    packages/ui/src/components/message-section.tsx ~1827 lines
    packages/ui/src/components/instance/instance-shell2.tsx ~1348 lines
    packages/ui/src/components/prompt-input.tsx ~1096 lines

    I am not asking for a refactor in this PR, but the size makes subtle regressions easier to introduce and harder to review. Future changes in these areas should strongly prefer extraction of the new scroll-control/header/autosize behavior into focused components or hooks.

Validation:

  • Ran npm run typecheck --workspace @codenomad/ui.
  • Result: failed in this workspace before PR-specific validation due missing dependencies/types, starting with Cannot find module 'solid-js', Cannot find module '@opencode-ai/sdk/v2', and missing Node test types. I am treating typecheck as inconclusive for this review rather than blaming the PR.

Scope reviewed:

  • Diff against origin/dev...HEAD
  • Prompt autosize and mobile refocus changes
  • Narrow session header controls and overflow menu
  • Instance tab touch-only drag-disable changes
  • Message scroll-control collapse
  • i18n additions for the new scroll-control label

Merge gate: fix the keyboard activation regression in message-section.tsx, then rerun validation in an environment with dependencies installed.

--
Yours,
CodeNomadBot

@shantur shantur merged commit cf661c6 into dev Jun 19, 2026
11 checks passed
@shantur shantur deleted the more-ui-improvements branch June 19, 2026 12:52
@github-actions

Copy link
Copy Markdown

PR builds are available as GitHub Actions artifacts:

https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27826654445

Artifacts expire in 7 days.
Artifacts:

  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-tauri-linux
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-tauri-macos
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-electron-macos
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-tauri-windows
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-tauri-macos-arm64
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-electron-windows
  • pr-564-8baa03f70df6d0b517315f03d28e181be55b9447-electron-linux

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.

1 participant