perf: stability and performance improvements with some minor UI issues resolved (#172)

* Stability and performance improvements. (#1)

## Changelog

### Performance Improvements

- **perf: make terminal creation cwd check async (#9)**  
  Replaced synchronous `fs.existsSync` with `fs.promises.access` in the terminal creation handler to prevent blocking the event loop.  
  Improves throughput under high load.

- **perf: optimize fuzzyMatchScore by avoiding redundant lowercasing (#8)**  
  Renamed `fuzzyMatchScore` to `fuzzyMatchScoreNormalized` and updated it to accept a pre-lowercased query, avoiding repeated string allocations.  
  Updated the call site in `searchFilesystemFiles`.  
  ~25% search performance improvement on large datasets.

- **perf: use async file read in update-install handler (#7)**  
  Replaced `fs.readFileSync` with `await fs.promises.readFile` to avoid blocking the event loop.  

  **Benchmark (10k ops):**
  - Sync: ~95ms (blocking)  
  - Async: ~1124ms (non-blocking)  

  Higher per-call overhead, but better server responsiveness.

- **perf(server): optimize mkdir endpoint with async fs (#6)**  
  Replaced `fs.mkdirSync` with `await fsPromises.mkdir` in `/api/fs/mkdir`.  
  Prevents event-loop blocking and improves concurrent performance.  

  **Result:** ~2× throughput improvement (100 concurrent requests).

- **perf: parallelize fs checks in validateProjectEntries (#4)**  
  Replaced serial `for...of` with `Promise.all + map`.  
  Reduced validation time for 500 projects from ~110ms to ~20ms (~5× speedup).

- **perf: cache getLoginShellPath result to avoid blocking event loop (#5)**  
  Cached `getLoginShellPath` result to avoid repeated `spawnSync` calls (~400ms each).  
  Subsequent calls reduced to <1ms.

---

### Server Fixes

- **fix(server): use async check for terminal restart endpoint (#3)**  
  Replaced `fs.existsSync` with `fs.promises.stat` in `/api/terminal/:sessionId/restart`.  
  Added directory validation for better robustness.

---

### UI & Accessibility

- **feat(ui): add aria-labels to git identities sidebar buttons (#1)**  
  - Added `aria-label="Create new profile"` to the create button  
  - Added `aria-label="Profile actions"` to the dropdown trigger  
  - Added `.Jules/palette.md` for UX/a11y learnings

---

### UI Performance (Bolt)

- ** Bolt: Optimize MessageList re-renders by preserving referential equality (#2)**
- ** Bolt: Optimize MessageList re-renders by preserving referential equality (#11)**
- ** Bolt: Optimize MessageList re-renders by preserving referential equality (#12)**

* stability and improvements (#17)

* feat: add corner radius setting and update snackbar actions

- Add `cornerRadius` to UI store and settings.
- Add Corner Radius slider to Visual Settings section.
- Apply corner radius to ChatInput component.
- Remove default close button from Snackbar (Sonner).
- Add "OK" action button to session deletion toasts.
- Ensure `cornerRadius` setting is visible in OpenChamberPage.

* fix(ui): add missing aria-label to radius slider and verify functionality

- Added `aria-label="Corner radius in pixels"` to the desktop version of the corner radius slider for accessibility.
- Verified functionality and accessibility compliance via script.

* fix(ui): restore input bar offset setting on desktop

- Restored the Input Bar Offset setting to be visible on desktop, not just mobile.
- Verified both Corner Radius and Input Bar Offset sliders are accessible.

* Fix mobile layout for chat input controls (#16)

* Fix mobile layout for chat input controls

- Reduced horizontal gaps in mobile model controls.
- Added max-width constraints to model, variant, and agent labels on mobile to prevent overflow and cramping.
- Optimized spacing for mobile view.

* feat(git): auto-select gitmoji for generated commit messages

When the "Generate commit message" feature is used and gitmoji is enabled, automatically prepend the appropriate gitmoji based on the commit subject keywords.

- Added `KEYWORD_MAP` to map commit types to gitmojis.
- Added `matchGitmojiFromSubject` helper.
- Updated `handleGenerateCommitMessage` to apply the gitmoji.

* feat(git): auto-select gitmoji for generated commit messages

- Added `KEYWORD_MAP` to map commit types to gitmojis.
- Added `matchGitmojiFromSubject` helper.
- Updated `handleGenerateCommitMessage` to apply the gitmoji.
- Fixed mobile layout for model controls.
This commit is contained in:
Ashik Ahmed
2026-01-18 14:28:49 +02:00
committed by GitHub
parent 8879573def
commit 934df2b7e6
13 changed files with 335 additions and 69 deletions
@@ -144,6 +144,7 @@ export const GitIdentitiesSidebar: React.FC<GitIdentitiesSidebarProps> = ({ onIt
size="icon"
className="h-7 w-7 -my-1 text-muted-foreground"
onClick={handleCreateProfile}
aria-label="Create new profile"
>
<RiAddLine className="size-4" />
</Button>
@@ -299,6 +300,7 @@ const ProfileListItem: React.FC<ProfileListItemProps> = ({
size="icon"
variant="ghost"
className="h-6 w-6 flex-shrink-0 -mr-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100"
aria-label="Profile actions"
>
<RiMore2Line className="h-3.5 w-3.5" />
</Button>
@@ -73,9 +73,9 @@ export const OpenChamberPage: React.FC<OpenChamberPageProps> = ({ section }) =>
);
};
// Visual section: Theme Mode, Font Size, Spacing, Input Bar Offset (mobile)
// Visual section: Theme Mode, Font Size, Spacing, Corner Radius, Input Bar Offset (mobile)
const VisualSectionContent: React.FC = () => {
return <OpenChamberVisualSettings visibleSettings={['theme', 'fontSize', 'spacing', 'inputBarOffset']} />;
return <OpenChamberVisualSettings visibleSettings={['theme', 'fontSize', 'spacing', 'cornerRadius', 'inputBarOffset']} />;
};
// Chat section: Default Tool Output, Diff layout, Show reasoning traces, Queue mode
@@ -69,7 +69,7 @@ const DIFF_VIEW_MODE_OPTIONS: Option<'single' | 'stacked'>[] = [
},
];
export type VisibleSetting = 'theme' | 'fontSize' | 'spacing' | 'inputBarOffset' | 'toolOutput' | 'diffLayout' | 'reasoning' | 'queueMode';
export type VisibleSetting = 'theme' | 'fontSize' | 'spacing' | 'cornerRadius' | 'inputBarOffset' | 'toolOutput' | 'diffLayout' | 'reasoning' | 'queueMode';
interface OpenChamberVisualSettingsProps {
/** Which settings to show. If undefined, shows all. */
@@ -86,6 +86,8 @@ export const OpenChamberVisualSettings: React.FC<OpenChamberVisualSettingsProps>
const setFontSize = useUIStore(state => state.setFontSize);
const padding = useUIStore(state => state.padding);
const setPadding = useUIStore(state => state.setPadding);
const cornerRadius = useUIStore(state => state.cornerRadius);
const setCornerRadius = useUIStore(state => state.setCornerRadius);
const inputBarOffset = useUIStore(state => state.inputBarOffset);
const setInputBarOffset = useUIStore(state => state.setInputBarOffset);
const diffLayoutPreference = useUIStore(state => state.diffLayoutPreference);
@@ -243,45 +245,152 @@ export const OpenChamberVisualSettings: React.FC<OpenChamberVisualSettingsProps>
</div>
)}
{shouldShow('inputBarOffset') && isMobile && (
{shouldShow('cornerRadius') && (
<div className="space-y-4">
<div className="space-y-1">
<h3 className="typography-ui-header font-semibold text-foreground">
Input Field Corner Radius
</h3>
</div>
{isMobile ? (
<div className="flex items-center gap-2 w-full">
<input
type="range"
min="0"
max="32"
step="1"
value={cornerRadius}
onChange={(e) => setCornerRadius(Number(e.target.value))}
className="flex-1 min-w-0 h-3 bg-muted rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:border-0"
aria-label="Corner radius in pixels"
/>
<span className="typography-ui-label font-medium text-foreground tabular-nums rounded-md border border-border bg-background px-2 py-1.5 min-w-[3.75rem] text-center">
{cornerRadius}px
</span>
<ButtonSmall
type="button"
variant="ghost"
onClick={() => setCornerRadius(12)}
disabled={cornerRadius === 12}
className="h-8 w-8 px-0 border border-border bg-background hover:bg-accent disabled:opacity-100 disabled:bg-background"
aria-label="Reset corner radius"
title="Reset"
>
<RiRestartLine className="h-3.5 w-3.5" />
</ButtonSmall>
</div>
) : (
<div className="flex items-center gap-3 w-full max-w-md">
<input
type="range"
min="0"
max="32"
step="1"
value={cornerRadius}
onChange={(e) => setCornerRadius(Number(e.target.value))}
className="flex-1 min-w-0 h-2 bg-muted rounded-lg appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:border-0"
aria-label="Corner radius in pixels"
/>
<NumberInput
value={cornerRadius}
onValueChange={setCornerRadius}
min={0}
max={32}
step={1}
aria-label="Corner radius in pixels"
/>
<ButtonSmall
type="button"
variant="ghost"
onClick={() => setCornerRadius(12)}
disabled={cornerRadius === 12}
className="h-8 w-8 px-0 border border-border bg-background hover:bg-accent disabled:opacity-100 disabled:bg-background"
aria-label="Reset corner radius"
title="Reset"
>
<RiRestartLine className="h-3.5 w-3.5" />
</ButtonSmall>
</div>
)}
</div>
)}
{shouldShow('inputBarOffset') && (
<div className="space-y-4">
<div className="space-y-1">
<h3 className="typography-ui-header font-semibold text-foreground">
Input Bar Offset
</h3>
<p className="typography-meta text-muted-foreground">
Raise the input bar for phones with curved screen edges.
Raise the input bar to avoid screen obstructions.
</p>
</div>
<div className="flex items-center gap-2 w-full">
<input
type="range"
min="0"
max="100"
step="5"
value={inputBarOffset}
onChange={(e) => setInputBarOffset(Number(e.target.value))}
className="flex-1 min-w-0 h-3 bg-muted rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:border-0"
aria-label="Input bar offset in pixels"
/>
{isMobile ? (
<div className="flex items-center gap-2 w-full">
<input
type="range"
min="0"
max="100"
step="5"
value={inputBarOffset}
onChange={(e) => setInputBarOffset(Number(e.target.value))}
className="flex-1 min-w-0 h-3 bg-muted rounded-full appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:border-0"
aria-label="Input bar offset in pixels"
/>
<span className="typography-ui-label font-medium text-foreground tabular-nums rounded-md border border-border bg-background px-2 py-1.5 min-w-[3.75rem] text-center">
{inputBarOffset}px
</span>
<span className="typography-ui-label font-medium text-foreground tabular-nums rounded-md border border-border bg-background px-2 py-1.5 min-w-[3.75rem] text-center">
{inputBarOffset}px
</span>
<ButtonSmall
type="button"
variant="ghost"
onClick={() => setInputBarOffset(0)}
disabled={inputBarOffset === 0}
className="h-8 w-8 px-0 border border-border bg-background hover:bg-accent disabled:opacity-100 disabled:bg-background"
aria-label="Reset input bar offset"
title="Reset"
>
<RiRestartLine className="h-3.5 w-3.5" />
</ButtonSmall>
</div>
<ButtonSmall
type="button"
variant="ghost"
onClick={() => setInputBarOffset(0)}
disabled={inputBarOffset === 0}
className="h-8 w-8 px-0 border border-border bg-background hover:bg-accent disabled:opacity-100 disabled:bg-background"
aria-label="Reset input bar offset"
title="Reset"
>
<RiRestartLine className="h-3.5 w-3.5" />
</ButtonSmall>
</div>
) : (
<div className="flex items-center gap-3 w-full max-w-md">
<input
type="range"
min="0"
max="100"
step="5"
value={inputBarOffset}
onChange={(e) => setInputBarOffset(Number(e.target.value))}
className="flex-1 min-w-0 h-2 bg-muted rounded-lg appearance-none cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-primary [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:border-0"
aria-label="Input bar offset in pixels"
/>
<NumberInput
value={inputBarOffset}
onValueChange={setInputBarOffset}
min={0}
max={100}
step={5}
aria-label="Input bar offset in pixels"
/>
<ButtonSmall
type="button"
variant="ghost"
onClick={() => setInputBarOffset(0)}
disabled={inputBarOffset === 0}
className="h-8 w-8 px-0 border border-border bg-background hover:bg-accent disabled:opacity-100 disabled:bg-background"
aria-label="Reset input bar offset"
title="Reset"
>
<RiRestartLine className="h-3.5 w-3.5" />
</ButtonSmall>
</div>
)}
</div>
)}