Compare commits

..

4 Commits

Author SHA1 Message Date
BOHA
596d21712a chore(release): v1.9.8 — compact mobile filter bars + AdminDatePicker everywhere
Combines the undeployed v1.9.7 (compact 2-up filter bars) with the date-field
unification (all date fields via AdminDatePicker + mode-aware placeholder).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 16:58:11 +02:00
BOHA
b504d9d0b2 fix(dates): use AdminDatePicker everywhere + mode-aware default placeholder
- The project create-modal start/end dates used raw <input type="date">;
  converted to <AdminDatePicker> so every date field in the app now goes
  through the shared component (react-datepicker on desktop, native on touch).
- AdminDatePicker now defaults its placeholder by mode (date 'dd.mm.rrrr',
  month 'mm.rrrr', time 'hh:mm') so empty date fields always show a format
  hint; explicit placeholders (e.g. 'Od'/'Do' range filters) still override.
- Dropped WarehouseReceiptForm's ad-hoc 'dd.mm.yyyy' so it inherits the
  unified Czech default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 16:57:52 +02:00
BOHA
e082a6ef06 chore(release): v1.9.7 — compact mobile filter bars
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 16:11:59 +02:00
BOHA
1662453d9c fix(mobile): compact 2-up filter bars instead of full-width column
.admin-search-bar on phones (<=768px) was flex-direction:column with each
control forced full-width (min-width:100% at <=480), so multi-filter bars
(warehouse receipts/issues, sales lists) became a tall stack of huge controls.
Now: the search box spans the row; filter selects/date pickers sit two-per-row;
the reset button spans the row. 44px/16px touch sizing unchanged; applies
consistently to every page using .admin-search-bar.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 16:11:46 +02:00
6 changed files with 51 additions and 36 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "app-ts",
"version": "1.9.6",
"version": "1.9.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "app-ts",
"version": "1.9.6",
"version": "1.9.8",
"license": "ISC",
"dependencies": {
"@dnd-kit/core": "^6.3.1",

View File

@@ -1,6 +1,6 @@
{
"name": "app-ts",
"version": "1.9.6",
"version": "1.9.8",
"description": "",
"main": "dist/server.js",
"scripts": {

View File

@@ -1094,37 +1094,44 @@
}
@media (max-width: 768px) {
/* Compact 2-up filter grid instead of a tall full-width column:
the search box spans the row; the filter selects / date pickers sit
two-per-row; the reset button spans the row. Touch sizing (44px height +
16px font from forms.css) is unchanged — this just halves the vertical
footprint of multi-filter bars on phones. */
.admin-search-bar {
flex-direction: column;
align-items: stretch;
}
.admin-search-bar .admin-form-input,
.admin-search-bar .admin-form-select {
max-width: 100%;
}
.admin-search-bar .react-datepicker-wrapper {
max-width: 100%;
/* Search box spans the full row (handles both the .admin-search wrapper
and a bare text input used directly as the search field). */
.admin-search-bar > .admin-search,
.admin-search-bar > .admin-form-input:not([type="date"]) {
flex: 1 1 100%;
max-width: none;
}
.admin-search {
max-width: 100%;
min-width: 0;
max-width: none;
}
/* Filters (status/supplier selects, native date inputs, datepicker
wrappers): two per row. */
.admin-search-bar > .admin-form-select,
.admin-search-bar > .admin-form-input[type="date"],
.admin-search-bar > .react-datepicker-wrapper {
flex: 1 1 calc(50% - 0.25rem);
min-width: 0;
max-width: none;
}
/* Action buttons (e.g. "Zrušit filtry") span the full row. */
.admin-search-bar > .admin-btn {
flex: 1 1 100%;
}
}
@media (max-width: 480px) {
.admin-search-bar .admin-form-input,
.admin-search-bar .admin-form-select {
min-width: 100%;
}
.admin-search-bar .react-datepicker-wrapper {
min-width: 100%;
}
}
/* ============================================================================
Item Picker (Warehouse)
============================================================================ */

View File

@@ -58,6 +58,7 @@ interface NativeInputProps {
minDate?: string;
maxDate?: string;
disabled?: boolean;
placeholder?: string;
}
const modeToInputType: Record<string, string> = {
@@ -73,6 +74,7 @@ function NativeInput({
minDate,
maxDate,
disabled,
placeholder,
}: NativeInputProps) {
const type = modeToInputType[mode] || "date";
// For time inputs, min/max must be in HH:mm format, not date format
@@ -95,6 +97,7 @@ function NativeInput({
value={value || ""}
onChange={(e) => onChange(e.target.value)}
className="admin-form-input"
placeholder={placeholder}
required={required}
disabled={disabled}
min={minProp}
@@ -126,6 +129,12 @@ export default function AdminDatePicker({
}: AdminDatePickerProps) {
const useNative = isTouchDevice();
// Mode-aware default placeholder so empty date fields always show a format
// hint (callers can still override, e.g. "Od"/"Do" on range filters).
const effectivePlaceholder =
placeholder ??
(mode === "time" ? "hh:mm" : mode === "month" ? "mm.rrrr" : "dd.mm.rrrr");
if (useNative) {
return (
<NativeInput
@@ -136,6 +145,7 @@ export default function AdminDatePicker({
minDate={minDate}
maxDate={maxDate}
disabled={disabled}
placeholder={effectivePlaceholder}
/>
);
}
@@ -181,7 +191,7 @@ export default function AdminDatePicker({
const customInput = (
<CustomInput
required={required}
placeholder={placeholder}
placeholder={effectivePlaceholder}
disabled={disabled}
/>
);
@@ -191,7 +201,7 @@ export default function AdminDatePicker({
onChange: handleChange,
locale: "cs",
customInput,
placeholderText: placeholder,
placeholderText: effectivePlaceholder,
minDate: parseMinMax(minDate),
maxDate: parseMinMax(maxDate),
popperPlacement: "bottom-start" as const,

View File

@@ -8,6 +8,7 @@ import { motion } from "framer-motion";
import ConfirmModal from "../components/ConfirmModal";
import FormModal from "../components/FormModal";
import FormField from "../components/FormField";
import AdminDatePicker from "../components/AdminDatePicker";
import { formatDate, czechPlural } from "../utils/formatters";
import SortIcon from "../components/SortIcon";
@@ -530,23 +531,21 @@ export default function Projects() {
<div className="admin-form-row">
<FormField label="Začátek">
<input
type="date"
<AdminDatePicker
mode="date"
value={createForm.start_date}
onChange={(e) =>
setCreateForm({ ...createForm, start_date: e.target.value })
onChange={(val) =>
setCreateForm({ ...createForm, start_date: val })
}
className="admin-form-input"
/>
</FormField>
<FormField label="Konec">
<input
type="date"
<AdminDatePicker
mode="date"
value={createForm.end_date}
onChange={(e) =>
setCreateForm({ ...createForm, end_date: e.target.value })
onChange={(val) =>
setCreateForm({ ...createForm, end_date: val })
}
className="admin-form-input"
/>
</FormField>
</div>

View File

@@ -378,7 +378,6 @@ export default function WarehouseReceiptForm() {
delivery_note_date: val,
}))
}
placeholder="dd.mm.yyyy"
/>
</FormField>
</div>