feat: enhance UI components and error handling

- Updated HTML structure for navigation buttons in the calendar, adding SVG icons for improved visual clarity.
- Introduced a new muted text style in CSS for better presentation of empty duty list messages.
- Enhanced calendar CSS for navigation buttons and day indicators, improving layout and responsiveness.
- Improved error handling in the UI by adding retry functionality to the error display, allowing users to retry actions directly from the error message.
- Updated internationalization messages to include a retry option for error handling.
- Added unit tests to verify the new error handling behavior and UI updates.
This commit is contained in:
2026-03-02 20:21:33 +03:00
parent 37d4226beb
commit 54446d7b0f
12 changed files with 154 additions and 19 deletions

View File

@@ -33,7 +33,7 @@
}
}
.loading, .error {
.loading {
text-align: center;
padding: 12px;
color: var(--muted);
@@ -45,7 +45,16 @@
}
.error {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 20px 16px;
margin: 12px 0;
background: var(--surface);
border-radius: 12px;
color: var(--error);
text-align: center;
}
.error[hidden], .loading.hidden,
@@ -53,6 +62,36 @@
display: none !important;
}
.error-icon {
flex-shrink: 0;
color: var(--error);
}
.error-text {
margin: 0;
}
.error-retry {
margin-top: 4px;
padding: 8px 16px;
font-size: 0.9rem;
font-weight: 500;
color: var(--bg);
background: var(--accent);
border: none;
border-radius: 8px;
cursor: pointer;
}
.error-retry:hover {
opacity: 0.9;
}
.error-retry:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Current duty view (Mini App deep link startapp=duty) */
[data-view="currentDuty"] .calendar-sticky,
[data-view="currentDuty"] .duty-list {
@@ -167,11 +206,19 @@
color: var(--muted);
margin-bottom: 16px;
line-height: 0;
width: 48px;
height: 48px;
border-radius: 50%;
background: color-mix(in srgb, var(--muted) 25%, transparent);
padding: 12px;
box-sizing: border-box;
}
.current-duty-no-duty-icon svg {
display: block;
opacity: 0.7;
width: 100%;
height: 100%;
opacity: 0.85;
}
.current-duty-no-duty {
@@ -282,8 +329,12 @@
.access-denied {
text-align: center;
padding: 24px 12px;
padding: 24px 16px;
margin: 12px 0;
background: var(--surface);
border-radius: 12px;
color: var(--muted);
box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 8%, transparent);
}
.access-denied p {