Files
CodeNomad/packages/ui/src/styles/messaging/prompt-input.css
MusiCode1 1c68f5d288 feat(i18n): Hebrew locale + full RTL support (#243)
# feat(i18n): Hebrew locale + full RTL support

## Summary

This PR adds full Hebrew (he) locale support to the UI, including a
complete translation of all user-facing strings and comprehensive RTL
layout support across all components.

## What was done

### Hebrew translation
- Full translation of all i18n message files for the `he` locale (17
translation files)
- Registered the language in the i18n system and the language picker

### RTL support
- Automatic direction detection (`dir="rtl"`) when Hebrew is selected
- Replaced physical CSS properties (`left`/`right`) with logical
equivalents (`inline-start`/`inline-end`) across the project
- Fixed resize direction, file path alignment, and textarea padding
- Fixed navigation button positioning in textarea for RTL
- Fixed scrollbar direction in RTL
- Fixed code block direction and selector alignment
- Fixed Monaco editor direction in the file viewer
- Auto-detect text direction in reasoning block (`dir="auto"` +
`unicode-bidi: plaintext`)

### Adapted components
- `session-layout` — sidebar and resize handle
- `prompt-input` — text direction and buttons
- `message-base` — message blocks and reasoning
- `message-timeline` — timeline bar
- `right-panel` — right side panel
- `tool-call` — tool call display
- `settings-screen` — settings page
- `selector` — selection component
- `instance-shell` — main shell

## New files

```
packages/ui/src/lib/i18n/messages/he/
  advancedSettings.ts
  app.ts
  commands.ts
  dialogs.ts
  filesystem.ts
  folderSelection.ts
  index.ts
  instance.ts
  loadingScreen.ts
  logs.ts
  markdown.ts
  messaging.ts
  remoteAccess.ts
  session.ts
  settings.ts
  time.ts
  toolCall.ts
```

## Suggested testing
- Switch language to Hebrew and verify all strings are translated
- Verify RTL layout is correct across all screens (session, settings,
file viewer)
- Verify that English text inside a reasoning block is displayed LTR
- Switch back to English and verify everything returns to LTR

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Shantur Rathore <i@shantur.com>
2026-03-24 21:09:52 +00:00

356 lines
7.3 KiB
CSS

.prompt-input-container {
@apply flex flex-col border-t;
border-color: var(--border-base);
background-color: var(--surface-base);
}
.prompt-input-wrapper {
@apply grid items-stretch;
grid-template-columns: minmax(0, 1fr) 64px;
gap: 0;
padding: 0;
}
.prompt-input-actions {
@apply flex flex-col items-center;
align-self: stretch;
height: 100%;
padding: 0.5rem 0.25rem;
gap: 0.5rem;
}
.prompt-input-field-container {
position: relative;
width: 100%;
min-height: 56px;
flex: 1 1 auto;
height: 100%;
min-width: 0;
}
.prompt-input-field {
position: relative;
width: 100%;
height: 100%;
}
.prompt-input {
@apply w-full pt-2.5 border text-sm resize-none outline-none transition-colors;
padding-inline-start: 2.5rem;
padding-inline-end: 0.75rem;
font-family: inherit;
background-color: var(--surface-base);
color: var(--text-primary);
caret-color: var(--text-primary);
border-color: var(--border-base);
line-height: var(--line-height-normal);
border-radius: 0;
padding-bottom: 0;
height: 100%;
min-height: 100%;
}
.prompt-input-field-container.is-expanded {
height: auto;
}
.prompt-input-field.is-expanded {
height: auto;
}
.prompt-input.is-expanded {
height: auto;
min-height: 0;
overflow-y: auto;
}
.prompt-input-overlay {
position: absolute;
bottom: 1rem;
inset-inline-start: 0.75rem;
inset-inline-end: 0.75rem;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
font-size: 0.75rem;
line-height: 1.3;
color: var(--text-muted);
pointer-events: none;
z-index: 1;
}
.prompt-input-overlay.shell-mode {
color: var(--text-primary);
}
/* Navigation buttons container (expand, prev, next).
Intentionally at inline-start (left in LTR, right in RTL) so buttons never overlap
the scrollbar, which browsers always place at inline-end. */
.prompt-nav-buttons {
position: absolute;
top: 0.25rem;
inset-inline-start: 0.25rem;
bottom: 0.25rem;
display: flex;
flex-direction: column;
justify-content: flex-start;
gap: 0.125rem;
z-index: 2;
}
.prompt-expand-button,
.prompt-history-button {
@apply w-7 h-7 flex items-center justify-center rounded-md;
color: var(--text-muted);
background-color: var(--control-ghost-bg);
transition: background-color 0.15s ease, color 0.15s ease;
padding: 0;
flex-shrink: 0;
}
.prompt-expand-button:hover:not(:disabled),
.prompt-history-button:hover:not(:disabled) {
background-color: var(--surface-secondary);
color: var(--text-primary);
}
.prompt-expand-button:active:not(:disabled) {
background-color: var(--accent-primary);
color: var(--text-inverted);
transform: scale(0.95);
}
.prompt-expand-button:disabled,
.prompt-history-button:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.prompt-overlay-text {
display: inline-flex;
align-items: center;
gap: 0.35rem;
}
.prompt-overlay-warning {
color: var(--status-warning);
font-weight: 500;
}
.prompt-overlay-shell-active {
color: var(--status-success);
font-weight: 600;
}
.prompt-overlay-muted {
color: var(--text-muted);
}
.prompt-input.shell-mode {
border-color: var(--status-success);
box-shadow: inset 0 0 0 1px var(--status-success-ring);
}
.prompt-input:focus {
border-color: var(--accent-primary);
}
.prompt-input.shell-mode:focus {
border-color: var(--status-success);
box-shadow: inset 0 0 0 1px var(--status-success-ring);
}
.prompt-input:disabled {
@apply opacity-60 cursor-not-allowed;
}
/* In RTL: override dir="auto" which defaults to LTR on empty textarea */
[dir="rtl"] .prompt-input {
direction: rtl;
}
.prompt-input::placeholder {
color: var(--text-muted);
}
.stop-button {
@apply w-10 h-10 rounded-md border-none cursor-pointer flex items-center justify-center transition-all flex-shrink-0;
background-color: var(--button-danger-bg, rgba(239, 68, 68, 0.85));
color: var(--button-danger-text, var(--text-inverted, #ffffff));
}
.stop-button:hover:not(:disabled) {
background-color: var(--button-danger-hover-bg, rgba(239, 68, 68, 0.9));
@apply opacity-95 scale-105;
}
.stop-button:active:not(:disabled) {
background-color: var(--button-danger-active-bg, rgba(239, 68, 68, 1));
@apply scale-95;
}
.stop-button:disabled {
@apply opacity-60 cursor-not-allowed;
}
.stop-icon {
width: 1rem;
height: 1rem;
}
.send-button {
@apply w-10 h-10 rounded-md border-none cursor-pointer flex items-center justify-center transition-all flex-shrink-0;
background-color: var(--accent-primary);
color: var(--text-inverted);
margin-top: auto;
}
.send-button.shell-mode {
background-color: var(--status-success);
}
.send-button.shell-mode:hover:not(:disabled) {
filter: brightness(1.05);
}
.send-button.shell-mode:active:not(:disabled) {
filter: brightness(0.95);
}
.send-button:hover:not(:disabled) {
@apply opacity-90 scale-105;
}
.send-button:active:not(:disabled) {
@apply scale-95;
}
.send-button:disabled {
@apply opacity-40 cursor-not-allowed;
}
.send-icon {
@apply text-base;
}
.shell-icon {
width: 1rem;
height: 1rem;
}
.hint {
@apply text-xs;
color: var(--text-muted);
}
.hint kbd {
@apply inline-block px-1.5 py-0.5 text-xs font-mono rounded mx-0.5;
background-color: var(--surface-secondary);
border: 1px solid var(--border-base);
border-radius: 3px;
}
.attachment-chip {
@apply px-2.5 py-1 text-xs font-medium ring-1 ring-inset;
background-color: var(--attachment-chip-bg);
color: var(--attachment-chip-text);
ring-color: var(--attachment-chip-ring);
}
.attachment-chip-image {
position: relative;
}
.attachment-chip-preview {
display: none;
position: absolute;
bottom: calc(100% + 6px);
inset-inline-start: 0;
padding: 8px;
background-color: var(--surface-base);
border: 1px solid var(--border-base);
border-radius: 10px;
box-shadow: var(--popover-shadow);
z-index: 20;
}
.attachment-chip-preview img {
display: block;
max-width: 320px;
max-height: 320px;
border-radius: 8px;
object-fit: contain;
}
.attachment-chip-image:hover .attachment-chip-preview {
display: block;
}
.attachment-remove,
.attachment-download,
.attachment-expand {
@apply ml-0.5 flex h-4 w-4 items-center justify-center rounded transition-colors;
}
.attachment-remove:hover,
.attachment-download:hover,
.attachment-expand:hover {
background-color: var(--attachment-chip-ring);
}
@media (pointer: coarse) {
.prompt-input-overlay {
display: none;
}
.prompt-input {
/* Prevent iOS Safari input zoom + keep input compact. */
font-size: 16px;
padding-bottom: 0.75rem;
}
}
@media (max-width: 1279px) {
:root {
--prompt-input-compact-height: 104px;
}
.prompt-input-wrapper {
min-height: var(--prompt-input-compact-height);
}
.prompt-input-field-container {
min-height: var(--prompt-input-compact-height);
height: var(--prompt-input-compact-height);
}
.prompt-input-field {
height: var(--prompt-input-compact-height);
}
.prompt-input-field-container.is-expanded,
.prompt-input-field.is-expanded {
height: auto;
}
}
@media (max-width: 720px) {
.prompt-input-wrapper {
grid-template-columns: minmax(0, 1fr) 40px;
}
}
@media (max-width: 640px) {
.prompt-input {
min-height: 0;
padding: 0.5rem 0.75rem;
padding-inline-start: 2.5rem; /* preserve space for nav buttons */
padding-bottom: 0.75rem;
}
.prompt-input-wrapper {
gap: 0;
padding: 0;
}
}