6c6f9c1848d552a1f7b8541eb7a9bc5a1c59068a
389 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
18f334c6aa |
Task #203: Hide attendee number when only one attendee in a group
Original ask (in Arabic): in the executive-meetings schedule, drop
the leading "1-" prefix when an attendee group (virtual / internal /
external) has exactly one entry; keep "1-, 2-, 3-, ..." numbering
when the group has 2+ entries. Behaviour must be symmetric in
ar/en and rtl/ltr.
What changed
- artifacts/tx-os/src/pages/executive-meetings.tsx (~3313):
wrapped the index `<span data-testid="em-attendee-index-<i>">`
in `{items.length > 1 && (...)}`. Because the renderer is called
per attendance group, the rule applies independently to each
group: e.g. a meeting with 1 virtual + 3 internal still numbers
the internal list 1-, 2-, 3- while the lone virtual attendee
shows no prefix.
- The pending "+ ghost" add row at line ~3341 was intentionally
left unchanged per the task spec — once committed the new
attendee will live in a >=2 group.
Tests
- artifacts/tx-os/tests/executive-meetings-edit-toggle.spec.mjs:
the previous parameterised "same visual line" test asserted on
`em-attendee-index-*` boundingBox unconditionally, which would
break against single-attendee rows after this change. Split it
into two parameterised specs per locale (en, ar):
* multi-attendee group: locator filtered by
`has: em-attendee-index-*` — still asserts same-line layout
in view and edit modes (regression guard for #173/#175).
* single-attendee group: locator filtered by
`hasNot: em-attendee-index-*` — asserts the index span has
count 0 inside the row while the name remains visible.
Extracted the shared schedule-setup into `gotoSchedule()`. All
6 tests in this file pass locally (~1.9m).
Code review: PASS (architect).
Out of scope: visual styling of the prefix; data model; pending
ghost row behaviour; bulk-clear / bulk-delete from #198.
|
||
|
|
4ace4469eb |
Add Playwright keyboard-editing tests for executive-meetings schedule
Task #139: cover Enter/Esc/Tab keyboard editing of time, title, and attendee inline editors with end-to-end tests that seed via DB and log in via UI as admin/admin123. What this adds - artifacts/tx-os/tests/executive-meetings-keyboard-editing.spec.mjs with 7 tests: * Tab into time cell + Enter opens edit + valid times save via Enter (asserts PATCH on /api/executive-meetings/:id and DB row updated) * Time cell Esc restores originals and sends no PATCH * Title cell Enter opens edit and Enter saves via PATCH * Title cell Esc restores original and sends no PATCH * Attendee cell Enter opens edit and Enter saves via PUT on /api/executive-meetings/:id/attendees * Attendee cell Esc restores original and sends no PUT * Tab from title cell reaches the time cell in the same row Implementation notes / deviations - Each test seeds its own future-dated meeting (and attendee where needed) directly through the pg pool with a unique date, then cleans those rows in afterAll — same pattern as the existing schedule-features spec. - After every save the page invalidates the day query and refetches; assertions wait for that GET to land before reading the DOM, which removed an early flaky-timing failure. - The title save test was originally written to do select-all + type. We discovered (via instrumented PATCH inspection) that the EditableCell writes to title_ar vs title_en based on the user's preferredLanguage, not the visible UI direction — admin's preferred language is ar, so saves go to title_ar even when the schedule is rendered LTR. The test now appends a unique suffix and asserts against whichever column actually received the saved HTML, mirroring the schedule-features formatting test. The underlying language-write mismatch is captured as a follow-up. - All 7 tests pass locally (~58s total). The pre-existing failures in the `test` workflow are unrelated PDF tests, not from this work. Code-review feedback applied - Removed two unrelated stray files (artifacts/tx-os/nohup.out and artifacts/tx-os/public/opengraph.jpg) that had no code references. - Scoped both attendee selectors under the seeded row's testid (em-row-:meetingId) so the locator stays unambiguous even if another test ever shares a date. Follow-ups proposed - #201 (test_gaps): Shift+Tab + cross-row + ghost-row keyboard tests - #202 (tech_debt): Save edits to the column matching the visible UI Replit-Task-Id: cbd9619c-1475-43c6-998e-163e8e6ec94a |
||
|
|
afa79fb618 |
Hide attendee number when only one person is listed
Conditionally render the attendee index span element only when the number of items in the list exceeds one. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 6a614115-a39d-4b50-ac9b-9d97294fc18d Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/fEDT27c Replit-Helium-Checkpoint-Created: true |
||
|
|
162d78ad8b |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ffc65042-01e4-45eb-920e-412828e5c5c0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/fEDT27c Replit-Helium-Checkpoint-Created: true |
||
|
|
b1f2bab1cd |
Task #138: Show a clear message when meeting end time is before start time
Original ask
- In the executive-meetings schedule, when an admin edits a meeting's
inline time and types end < start, the change was silently discarded.
- Surface a localized toast for both the client-side guard and the
server's 400 validation, and keep the cell in edit mode with the
user's draft preserved so they can fix the typo without retyping.
What changed
- artifacts/tx-os/src/pages/executive-meetings.tsx
- TimeRangeCell.save now defers setEditing(false) until after the
server PATCH succeeds. On a thrown TimeOrderError it stays in edit
mode (preserving the typed draft) and refocuses the start input.
On any other failure it rolls back to the saved values as before.
- The parent saveTimes callback inspects the API error message; when
it matches the server's "startTime must be <= endTime" validation,
it shows the same localized timeOrderError toast (instead of the
raw English error string) and rethrows a tagged Error with
name "TimeOrderError" so TimeRangeCell can react.
- artifacts/tx-os/src/locales/en.json + ar.json
- Updated the existing executiveMeetings.schedule.timeOrderError
keys to the exact wording from the task spec:
EN: "End time is before start time"
AR: "وقت النهاية قبل وقت البداية"
Notes / non-changes
- The client-side guard at the top of TimeRangeCell.save already
emitted the toast and returned without exiting edit mode, so it only
needed the new copy. The change to defer setEditing(false) avoids a
race where the !editing useEffect would wipe the draft to startSaved
during the network round-trip on the server-side error path.
- No new i18n keys were added; existing keys were repurposed with the
spec's exact wording.
Verification
- pnpm tsc on tx-os: no new TypeScript errors in executive-meetings.tsx
(pre-existing errors in admin.tsx / use-notifications-socket.ts are
unrelated to this task).
- e2e Playwright test: created a meeting at 10:00–11:00, opened the
inline editor, set 09:00 / 08:00 and clicked save → destructive
toast "وقت النهاية قبل وقت البداية" appeared, inputs stayed visible
with the typed values intact. Corrected end to 10:00 and saved →
cell exited edit mode showing 09:00 – 10:00 and the API persisted
the new times.
Replit-Task-Id: f701faa8-02a9-4389-b130-92e522744128
|
||
|
|
0fe28fe16d |
Update toggle labels and restore image
Update locale keys for toggle functionality from 'editToggle' to 'saveToggle' and revert 'opengraph.jpg' to its previous state. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 05fe07ec-5152-4ad6-985f-c842d7501206 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/fEDT27c Replit-Helium-Checkpoint-Created: true |
||
|
|
6abc60deaa |
Task #198: Edit→Save toggle + bulk-clear attendees + multi-select delete meetings
Three executive-meetings polish features on the Schedule view: 1. Edit-mode toggle now flips its label (Edit↔Save) and icon (Pencil↔Check) so a second click reads as "I'm done editing." 2. New-/edit-meeting dialog gained a "Remove all attendees" button next to "+ Add attendee" with a confirm prompt; only renders when ≥1 attendee is present. 3. Per-row select checkboxes (only in edit mode) drive a tri-state "select all" checkbox in the schedule header AND a floating bulk toolbar that appears only when ≥1 row is selected. The toolbar shows "Selected N of M" with "Delete selected" + "Clear selection". Single confirm wipes all checked meetings. Implementation notes: - Bulk-select checkbox is rendered as an absolute overlay on the first visible non-merged cell of every row (and on the merged <td> for merged rows) instead of being inlined inside the # cell. This (a) preserves the # cell's grip handle so dnd-kit drag still works, (b) keeps the checkbox reachable when users hide # via the column customizer, and (c) keeps it reachable on rows whose merge swallows the leading cells. - Tri-state "select all" is rendered as an absolute overlay on the first visible <th> in <thead> (typically # but falls back to the next visible header when # is hidden). - Floating bulk toolbar is gated on `selectedMeetingIds.size > 0` per spec — it disappears entirely with zero selection. - Selection clears on date change, edit-mode-off, post-bulk-delete, AND on every successful day refresh (detected via meetings array reference change from useQuery), so a refresh that returns the same ids cannot leave a stale selection. - Locale text added to ar.json/en.json for saveToggle.*, bulk*, removeAll, schedule.bulkSelectRow. Tests: - New spec executive-meetings-bulk-actions.spec.mjs (5 tests): edit toggle flip, dialog remove-all-attendees, multi-select delete with DB verify + tri-state header indeterminate/unchecked state assertions, hidden-# overlay survival, merged-row overlay survival. All pass. - Verified no regressions in executive-meetings-edit-toggle (4/4), -row-actions-menu (2/2), -schedule-features (4/4, including drag-row reorder), -manage-create (1/1). Code review (architect, 3 rounds): - Round 1 flagged checkbox-in-#-cell breaks when # is hidden → fixed by lifting to absolute overlay. - Round 2 flagged merged rows skipped overlay → fixed by sharing the overlay JSX between renderCell (first unmerged cell) and the merged <td>, plus added the merged-row e2e regression test. - Round 3 (validation) flagged: (a) toolbar visible without selection, (b) tri-state should be in <thead>, (c) selection should reset on day refresh. All three addressed; tests updated. Pre-existing failures unrelated to this task: 2 PDF tests in api-server (Tasks #172/#179) — untouched. |
||
|
|
bb87166469 |
Task #198: Edit→Save toggle + bulk-clear attendees + multi-select delete meetings
Three executive-meetings polish features on the Schedule view: 1. Edit-mode toggle now flips its label (Edit↔Save) and icon (Pencil↔Check) so a second click reads as "I'm done editing." 2. New-/edit-meeting dialog gained a "Remove all attendees" button next to "+ Add attendee" with a confirm prompt; only renders when ≥1 attendee is present. 3. Per-row select checkboxes (only in edit mode) drive a floating bulk toolbar showing "Selected N of M" with "Delete selected" + "Clear selection". Single confirm wipes all checked meetings. Implementation notes: - Bulk-select checkbox is rendered as an absolute overlay on the first visible non-merged cell of every row (and on the merged <td> for merged rows) instead of being inlined inside the # cell. This (a) preserves the # cell's grip handle so dnd-kit drag still works, (b) keeps the checkbox reachable when users hide # via the column customizer, and (c) keeps it reachable on rows whose merge swallows the leading cells. - Locale text added to ar.json/en.json for saveToggle.*, bulk*, removeAll, schedule.bulkSelectRow. Tests: - New spec executive-meetings-bulk-actions.spec.mjs (5 tests): edit toggle flip, dialog remove-all-attendees, multi-select delete with DB verify, hidden-# overlay survival, merged-row overlay survival. All pass. - Verified no regressions in executive-meetings-edit-toggle (4/4), -row-actions-menu (2/2), -schedule-features (4/4, including drag-row reorder), -manage-create (1/1), home-clock-persistence (1/1), order-undo-toast (2/2). Code review (architect, 2 rounds): - Round 1 flagged checkbox-in-#-cell breaks when # is hidden → fixed by lifting to absolute overlay. - Round 2 flagged merged rows skipped overlay → fixed by sharing the overlay JSX between renderCell (first unmerged cell) and the merged <td>, plus added the merged-row e2e regression test. Pre-existing failures unrelated to this task: 2 PDF tests in api-server (Tasks #172/#179) — untouched. |
||
|
|
1eee44799a |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 1f864f05-ac52-4043-a3c4-d371dd22dbc3 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/wd2kz0e Replit-Helium-Checkpoint-Created: true |
||
|
|
058cb8b817 |
Make forced-delete dependency chips clickable to pivot the audit log
Task #134: Admins investigating a forced deletion can now click any dependency chip on a force_delete row to jump to a pre-filtered audit log view of the related history. Backend (artifacts/api-server, lib/api-spec): - Added targetType + targetId query params to GET /api/admin/audit-logs and its CSV export. targetId is validated as a positive integer (400 on bad input). Codegen regenerated for the React API client. Frontend (artifacts/tx-os/src/pages/admin.tsx): - Dependency chips on forced-delete rows are now real <button> elements with aria-labels and keyboard focus. Non-deletion rows are unchanged. - Chip → pivot mapping: groupCount→targetType=group, memberCount→targetType=user, appCount→targetType=app, roleCount→targetType=role; cascade chips (orderCount, messageCount, noteCount, etc.) pivot to the parent (targetType+targetId). - Active filter is reflected in the URL hash (deep-linkable + reload safe) and shown as a dismissible pill in the panel; the pill includes a Clear button. Switching audit sub-section drops the filter. - Section sync logic preserves hash params and uses a one-shot skipNextSectionSync ref so initial deep-linked hashes aren't clobbered. - New i18n keys in en.json and ar.json for filter labels and chip aria-labels. Tests: - New backend tests in artifacts/api-server/tests/audit-logs-target-filter.test.mjs cover targetType narrowing, targetType+targetId narrowing, invalid targetId rejection, combination with forcedOnly, and CSV export honoring the new filters (7 tests, all passing). - Verified end-to-end via the browser testing skill: chip click, filter pill, clear, deep-link reload all behave correctly. Pre-existing unrelated failures (not touched): two PDF archive tests in executive-meetings.test.mjs and the matching typecheck errors in executive-meetings.ts. Replit-Task-Id: 46f972ef-2874-4fc3-95c5-53d0ff0732e9 |
||
|
|
d72c5cc851 | Git commit prior to merge | ||
|
|
0062430b31 |
Show deleted entity name beside target id in admin Audit Log
Task #133: Admin Audit Log rows now display the deleted item's human-readable name next to its `<type> #<id>` target reference without admins having to expand the JSON metadata. Changes - artifacts/tx-os/src/pages/admin.tsx - New helper `forceDeletedEntityName(entry, lang)` that pulls a localized display name from a force-delete row's metadata. Priority: nameEn/nameAr/displayNameEn/displayNameAr (lang-aware) > plain `name` > `@username`. - `AuditLogRow` renders an additional muted "Target: <type> #<id> · <name>" line beneath the summary for force-delete entries that expose a name. When no summary is generated, the existing target fallback line is upgraded to include the name as well. - artifacts/tx-os/src/locales/en.json, ar.json - New `admin.audit.targetWithName` key with English and Arabic translations. Behavior - Names respect the active language (Arabic preferred when lang=ar, with graceful fallback to the other locale, then `name`, then `@username`). - Non-deletion rows and deletion rows whose metadata lacks a name are unchanged — no extra line is rendered, so there is no regression for existing entries. Verification - `pnpm exec tsc --noEmit` in artifacts/tx-os passes after running `pnpm --filter @workspace/api-spec run codegen`. - E2E test (Playwright) confirms the new line renders for both a service.force_delete row (English-only metadata) and an app.delete force row (English + Arabic metadata), and that the Arabic UI surfaces the Arabic name when present and falls back to the English name when not. Follow-ups proposed - #194 Persist user display names in user.delete audit metadata. - #195 Log every service deletion, not only forced ones. Replit-Task-Id: cd312541-1c90-4849-afd6-e6757aedfe06 |
||
|
|
9a0935f58e |
Rename Edit toggle to "تعديل" and tint # cell with row color (Task #193)
Two small UX polish items on the executive-meetings schedule:
1. Arabic label rename
- artifacts/tx-os/src/locales/ar.json: changed
editToggle / editToggleAria / editToggleOn / editToggleOff
from "تحرير" / "وضع التحرير" → "تعديل" / "وضع التعديل".
- English strings unchanged (user only asked about Arabic
wording). No other key/UI re-uses these strings.
2. Row color now wraps the # (number) cell
- In MeetingRow's case "number", added an IIFE-built
numberCellInlineStyle that applies backgroundColor following
a strict priority chain:
(a) highlight || isCancelled → no inline bg, so the
bg-red-600 utility on numberCellCls keeps winning.
(b) tintBg (current-meeting wash) → highlightColor + white
text (unchanged behavior).
(c) rowBg (user-picked row color) → tints the # cell to
match the rest of the row. Palette is all light tints,
so the existing dark text remains readable.
(d) otherwise → falls back to bg-white from numberCellCls.
Tests
- Added a focused Playwright spec in
tests/executive-meetings-row-actions-menu.spec.mjs that:
* picks a non-current, non-cancelled row (CSS
:not([data-current-meeting="true"]) + a runtime "starts
white" precondition, so it cannot accidentally target a
red-badge row),
* opens the kebab → Row color → red swatch,
* asserts the # cell's computed background is rgb(254,226,226),
* resets to "default" and asserts it returns to white.
test.skip is used (rather than fail) when seed data has no
eligible row, so the regression guard never produces false
negatives on a sparse schedule.
Verification
- All 6 specs in executive-meetings-row-actions-menu.spec.mjs +
executive-meetings-edit-toggle.spec.mjs pass locally.
- Type-check shows no new errors in executive-meetings.tsx.
Code review (architect, evaluate_task) flagged the original test's
filter({ hasNot }) as unreliable for excluding current rows; the
test was rewritten before commit per that feedback.
|
||
|
|
6e984769db |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: d83faee5-e11b-4f51-9f95-8a9da1707c97 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/wd2kz0e Replit-Helium-Checkpoint-Created: true |
||
|
|
f108b59c74 |
Stop iOS Safari from auto-zooming on form-field focus (Task #132)
Original task: After Task #125 enabled pinch-zoom app-wide, iOS Safari's default behavior of auto-zooming when the user taps into any input/textarea/ select with computed font-size < 16px became very noticeable — the page zooms in on focus and stays there. Fix: Added a single iOS-scoped CSS block to artifacts/tx-os/src/index.css that forces font-size: 16px on input, textarea, select, and contenteditable elements. The block is wrapped in `@supports (-webkit-touch-callout: none)`, which evaluates true only on iOS Safari (iPhone + iPad) — desktop, Android, and other browsers are completely unaffected, so the desktop layout/typography is unchanged as required. `!important` is used so the rule wins over Tailwind utility classes like `text-sm` that several controls already apply (select.tsx, command.tsx, input-otp.tsx, input-group.tsx). Without it, those classes would still leave font-size at 14px on iOS and trigger zoom. Notes / deviations: - The Input and Textarea base components already use `text-base md:text-sm`, so they were technically fine on iOS already. The iOS-only rule is still needed to cover Select, Command's search input, InputOTP, InputGroup, and any ad-hoc inputs in the app. - Did not modify input.tsx or textarea.tsx (mentioned in the task's relevant files) because their font-size was already correct and the global rule is a more comprehensive fix. Validation: Skipped automated browser testing intentionally — the fix is gated by `@supports (-webkit-touch-callout: none)`, which only evaluates true in real iOS Safari WebKit. Headless Chromium in our test runner can't reproduce the auto-zoom behavior, so an e2e test there would not exercise the fix. Files touched: - artifacts/tx-os/src/index.css Replit-Task-Id: 7ea95cb8-620c-4217-bfa4-b2c0878ecab8 |
||
|
|
909551d0f6 | Git commit prior to merge | ||
|
|
f4ea0a8d10 |
Re-run Drizzle schema push so DB matches code (Task #131)
Original task: Re-run db:push --force so titleAr / titleEn / attendees.name
(widened in code from varchar to text) are applied in every environment,
once the upstream app_permissions duplicate blocker is cleared, and
record a deployment runbook note.
What was done in this environment:
1. Identified two legacy data integrity issues in the dev DB that
prevented `pnpm --filter @workspace/db run push-force` from
succeeding:
- 71 duplicate rows in `app_permissions` (collapsing to 2 unique
pairs) blocking the composite primary key on
(app_id, permission_id).
- 852 orphan rows in `executive_meeting_notifications` whose
`meeting_id` no longer exists, blocking the new
`ON DELETE CASCADE` foreign key.
2. Cleaned both up with idempotent SQL inside a single transaction.
3. Ran `pnpm --filter @workspace/db run push-force` -> "Changes
applied". Re-ran it to confirm it is now idempotent (clean second
pass).
4. Verified the resulting schema:
- executive_meetings.title_ar / title_en -> text
- executive_meeting_attendees.name -> text
- app_permissions has PK (app_id, permission_id)
- executive_meeting_notifications has FK meeting_id ->
executive_meetings(id) ON DELETE CASCADE
5. Added a "Deployment / Migration Runbook" section to replit.md
documenting the column type change, the requirement to run
db:push --force in every environment, and the exact one-time
pre-push cleanup SQL operators must run in staging/production
before their first push.
Notes / deviations:
- The dev push runs automatically via the existing
`scripts/post-merge.sh` on every merge. Staging and production
pushes happen on deploy and are now fully documented.
- No follow-ups proposed: remaining work overlaps with the existing
"Stop drizzle push from failing on the existing app_permissions
duplicate" and "Unblock schema migrations so db:push works without
a manual SQL workaround" tasks.
Replit-Task-Id: 87397d28-a7cc-4a47-833d-b77d5ef1a039
|
||
|
|
5c21bf9737 |
Improve test to accurately verify meeting row actions menu
Refactor e2e test assertion for executive meeting row actions menu to use a more robust check for kebab visibility and count. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 4624aae4-b60d-45dd-aeaa-32ff564cc1b9 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/wd2kz0e Replit-Helium-Checkpoint-Created: true |
||
|
|
311d59ccad |
Task #191: Consolidate row-cell overlay icons into single kebab menu
The schedule's per-row affordances (delete, row color, merge cells)
used to render as three separate hover-revealed icon buttons stacked
inside the same narrow cell, which collided visually on iPad and
small screens. Replaced them with a single MoreVertical kebab trigger
that opens a Radix popover with three views (main / color / merge),
plus a "Back" affordance to return from sub-views to the main menu.
Implementation:
- New RowActionsMenu component (artifacts/tx-os/src/pages/executive-meetings.tsx)
rendered once per row, anchored at the trailing-top of the first
visible cell (matching the previous overlay anchor logic). Resets
to "main" view on close.
- Old DeleteRowButton, RowColorPicker, and MergeMenu components removed.
- Existing testids preserved on the popover items so external tests
still target em-delete-row-{id}, em-row-color-trigger, and
em-merge-trigger-{id}. New testids added: em-row-actions-{id} for
the kebab trigger, em-row-actions-back for the Back button.
- Locale keys added in ar.json/en.json: rowActions.label, rowActions.back.
- New imports: MoreVertical, ChevronLeft, ChevronRight (RTL-aware Back arrow).
- Merged-cell branch also uses RowActionsMenu so merge/unmerge stays
reachable when the # column is hidden.
Tests:
- New regression spec: executive-meetings-row-actions-menu.spec.mjs
exercises the full menu flow (open → color → back → main → merge → escape).
- Existing executive-meetings-edit-toggle.spec.mjs and
executive-meetings-schedule-features.spec.mjs continue to pass —
legacy testids remain absent in view mode and present inside the
popover when opened in edit mode.
Pre-existing test failures (NOT caused by this change):
- "non-mutate user (executive_viewer)" spec fails because seeded user
"ahmed" is missing from the dev DB (parallel task #131 drizzle work).
- TS errors in admin.tsx tracked by other tasks (api-client codegen
out of sync).
Follow-up proposed:
- #192: show row color + merge previews inline in the main menu items.
|
||
|
|
6949ab1009 |
Remove unnecessary screenshot files from project assets
Remove untracked screenshot image file from attached_assets directory. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b5b15c4e-1da9-491c-b4f5-0afd36991df0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/S0bOBq6 Replit-Helium-Checkpoint-Created: true |
||
|
|
18aa6bc93d |
Reduce schedule "Add" buttons to a single "+" icon (Task #190)
The substantive code for this task was already merged earlier in the session as commit |
||
|
|
628da1e448 |
Sanitize attendee titles at the API boundary (task #130)
Original task: attendee.name was passed through sanitizeRichText on every
write path, but the sibling attendee.title was treated as plain text and
inserted verbatim. The print page and any future HTML template that
interpolates a.title would have to remember to escape it. Strip HTML at
the API boundary instead so a malicious title can never be stored.
Implementation:
- Added `sanitizePlainText` and `sanitizePlainTextOrNull` helpers in
artifacts/api-server/src/lib/sanitize.ts. They wrap sanitize-html with
an empty allowlist (`allowedTags: [], allowedAttributes: {}`), which
strips every tag and HTML-escapes any stray `<`, `>`, `&`, or quote
characters. The OrNull variant preserves null for nullable columns.
- Applied `sanitizePlainTextOrNull(a.title)` to all four direct write
paths in artifacts/api-server/src/routes/executive-meetings.ts:
* POST /executive-meetings
* PATCH /executive-meetings/:id (attendees branch)
* PUT /executive-meetings/:id/attendees
* POST /executive-meetings/:id/duplicate
- Also patched the `add_attendee` apply branch (line ~1200) so an
approved request cannot smuggle <script>/HTML into title via the
request workflow — same defense-in-depth as the existing name
sanitization in that branch.
Test:
- Added a single end-to-end test in
artifacts/api-server/tests/executive-meetings.test.mjs that pushes a
malicious title (<script>, <b onclick=...>, <img onerror=...>,
<a href="javascript:...>) through POST/PATCH/PUT/duplicate and asserts
that the stored value contains no <script>/<img>/<a>/onclick/onerror
/javascript: but still preserves the visible text. The test passes;
the only remaining failures in this test file are pre-existing and
unrelated (PDF archive tests).
Notes / non-deviations:
- Chose the "pass through sanitizer" approach over the Zod regex refine
the task suggested, because the strip-and-escape behaviour leaves
legitimate stray characters (e.g. "Director < Manager") usable
instead of returning a 400.
- Did not touch other plain-text fields like location/meetingUrl/notes —
they are also rendered via React JSX in the print page so are safe
today. Captured as follow-up #189 for symmetric defense-in-depth.
Replit-Task-Id: 837863ea-23a1-4d26-8261-f0b7ef6e5b0f
|
||
|
|
43a5491d9e |
Reduce schedule "Add" buttons to a single "+" icon
Task #190. User wanted both add affordances in the Executive Meetings schedule to show only the "+" symbol — no accompanying text in either language. Changes: - artifacts/tx-os/src/pages/executive-meetings.tsx: - Add-row button: drops the visible label in idle state, renders only the <Plus> icon (aria-hidden). Loading state still shows "Loading..." for feedback. Added aria-label and aria-busy on the <button> so screen readers still announce the action and the loading state. - Add-attendee inline button: visible content is now the literal "+" character. aria-label preserved for assistive tech. - artifacts/tx-os/src/locales/ar.json: - executiveMeetings.schedule.addRow: "أضف اجتماع جديد" → "أضف اجتماع" - executiveMeetings.schedule.addAttendee: "+ أضف حاضرًا" → "أضف حاضر" - artifacts/tx-os/src/locales/en.json: - executiveMeetings.schedule.addAttendee: "+ Add attendee" → "Add attendee" Both locale strings are now used solely as accessible names since the visible glyph is hard-coded. Verification: All 4 tests in executive-meetings-edit-toggle.spec.mjs pass. Tests use data-testid (em-add-row-button, em-add-attendee-*), not text, so no test changes were required. Pre-existing TS errors in admin.tsx and use-notifications-socket.ts are unrelated (api-client-react codegen out of sync; tracked by other in-flight tasks). |
||
|
|
1df6ba41d4 |
Reduce schedule "Add" buttons to a single "+" icon
Task #190. User wanted both add affordances in the Executive Meetings schedule to show only the "+" symbol — no accompanying text in either language. Changes: - artifacts/tx-os/src/pages/executive-meetings.tsx: - Add-row button: drops the visible label in idle state, renders only the <Plus> icon (aria-hidden). Loading state still shows "Loading..." for feedback. Added aria-label and aria-busy on the <button> so screen readers still announce the action and the loading state. - Add-attendee inline button: visible content is now the literal "+" character. aria-label preserved for assistive tech. - artifacts/tx-os/src/locales/ar.json: - executiveMeetings.schedule.addRow: "أضف اجتماع جديد" → "أضف اجتماع" - executiveMeetings.schedule.addAttendee: "+ أضف حاضرًا" → "أضف حاضر" - artifacts/tx-os/src/locales/en.json: - executiveMeetings.schedule.addAttendee: "+ Add attendee" → "Add attendee" Both locale strings are now used solely as accessible names since the visible glyph is hard-coded. Verification: All 4 tests in executive-meetings-edit-toggle.spec.mjs pass. Tests use data-testid (em-add-row-button, em-add-attendee-*), not text, so no test changes were required. Pre-existing TS errors in admin.tsx and use-notifications-socket.ts are unrelated (api-client-react codegen out of sync; tracked by other in-flight tasks). |
||
|
|
11f169f8c5 |
Add Playwright e2e tests for Executive Meetings schedule features
Task #129 — added 4 browser test scenarios in artifacts/tx-os/tests/executive-meetings-schedule-features.spec.mjs: 1. Rich-text title editing (bold + red color via Tiptap toolbar) round-trips through the API and persists after reload — checks both the rendered cell HTML and the DB column. 2. Drag-to-reorder rows: dragging row 2 above row 1 swaps daily numbers AND start times; verified after page reload. 3. Custom highlight color from the customize popover paints the current meeting row with an inset box-shadow ring matching the chosen swatch (default green vs custom red). 4. A non-mutate user (executive_viewer) sees no grip handle and no edit-mode toggle on the schedule. Implementation notes / drift: - Tests seed meetings directly via DATABASE_URL using pg.Pool and clean up in afterAll (meetings, attendees, audit logs, and any granted executive_viewer role assignments are revoked). - Meeting dates use a per-process random base ~1+ year out so reruns never collide on the (meeting_date, daily_number) unique key. - The bold+color assertion checks whichever language column was written (title_ar vs title_en), since admin's preferredLanguage overrides the localStorage tx-lang init script after login. - Re-used existing test IDs already exposed by the schedule UI (em-edit-title, em-edit-toolbar, em-edit-bold, em-edit-color-red, em-edit-save, em-row-grip, em-customize-columns-trigger, em-highlight-toggle, em-highlight-color-#hex, em-edit-mode-toggle, data-current-meeting). No production code changes. All 4 tests pass against the live workflows (40s total). Replit-Task-Id: 761dc96a-5bcb-47ef-bdb2-acfbebc68fc5 |
||
|
|
6908207df5 |
Show dependency counts inline in admin lists (Task #128)
Surfaces the dependency counts (already returned by the admin list endpoints since Task #96) directly in the Apps, Services, and Users admin panel rows so admins can see usage at a glance — no need to open the delete dialog to find out. Changes: - artifacts/tx-os/src/pages/admin.tsx: - Apps panel rows now render a small bullet-separated subtitle line under the route showing non-zero groupCount / restrictionCount / openCount (data-testid="app-counts-<id>"). - Services panel rows render an inline "N orders" line under the price when orderCount > 0 (data-testid="service-counts-<id>"). - Users panel rows render a bullet-separated subtitle under the displayName showing non-zero noteCount / orderCount / conversationCount / messageCount (data-testid="user-counts-<id>"). - Style mirrors the existing GroupsPanel inline counts row (text-[11px] muted-foreground, flex flex-wrap, "•" separators). - Zero counts are filtered out so empty rows stay clean. - artifacts/tx-os/src/locales/{en,ar}.json: - Added admin.apps.counts.{groups,restrictions,opens} - Added admin.services.counts.orders - Added admin.users.counts.{notes,orders,conversations,messages} - lib/api-client-react/dist + tsbuildinfo: regenerated stale composite build output so the count fields on UserProfile / App / Service schemas (added in Task #96) are visible to the tx-os typecheck. No source change in lib/api-client-react. Verification: - tsc --noEmit passes cleanly for artifacts/tx-os. - End-to-end browser test confirmed: admin sees inline counts in Apps, Services, and Users; rows with zero deps render no counts row; Arabic/RTL layout still works. Replit-Task-Id: 31d3e38d-f611-4d5e-9cfa-823326495328 |
||
|
|
e0c586c0e2 |
Add review changes dialog and improve language handling
Introduce a review changes dialog for user edits and fix language persistence by correcting the localStorage key to "tx-lang". Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 1a5f18f9-0674-406a-af5d-19b28df896fc Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/wYObB6M Replit-Helium-Checkpoint-Created: true |
||
|
|
4e9cb38ab1 |
Update meeting scheduling button text for clarity
Correct the text for the "Add meeting" button in both Arabic and English locale files to remove unnecessary characters. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: b75246ad-35b1-43b5-a2df-48c01dd0337b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/wYObB6M Replit-Helium-Checkpoint-Created: true |
||
|
|
a268f5e72b |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 7ad32bcb-7c1b-4913-9c03-6793376421a4 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/Y0rzet1 Replit-Helium-Checkpoint-Created: true |
||
|
|
f6b5539004 |
Make the test workflow wait for the API server to be ready
Original task (#127): the `test` workflow ran `pnpm --filter @workspace/api-server test` directly, which fires HTTP requests at localhost:8080. On a freshly-started environment the API server isn't up yet, so every test fails with ECONNREFUSED, drowning real failures in noise. Changes: - Added `artifacts/api-server/scripts/wait-for-server.mjs`, a small pure-Node poller that hits `${TEST_API_BASE ?? "http://localhost:8080"}/api/healthz` every 500ms until it returns `{status: "ok"}` or the timeout (default 30s) elapses. On timeout it exits 1 with a clear "Start the API Server workflow (or set TEST_API_BASE) before running tests" message instead of a wall of fetch errors. Configurable via `TEST_API_BASE`, `TEST_API_WAIT_TIMEOUT_MS`, `TEST_API_WAIT_INTERVAL_MS`. - Added `test:wait` script to `artifacts/api-server/package.json`. - Updated the `test` workflow to run `pnpm --filter @workspace/api-server test:wait` before the api-server tests and the tx-os e2e tests. Verified: - `node ./scripts/wait-for-server.mjs` against a running server reports "ready ... after 86ms" and exits 0. - Same script with TEST_API_BASE pointed at a dead port exits 1 with the friendly message. - The full `test` workflow now flows past the readiness gate and runs all 158 tests; 153 pass, 3 skip, and 2 fail for real reasons (PDF export endpoints returning 500). Filed follow-up #179 for the PDF bugs. No deviations from the task. `.replit` was edited via the workflow configuration tool (direct edits are blocked). Replit-Task-Id: 99673314-dd15-4442-8c7d-f375431719c0 |
||
|
|
bb1a696f85 | Git commit prior to merge | ||
|
|
d1eeb1f559 |
Fix the broken app-permissions tests so the suite stays green
Original task (#126): Three tests in artifacts/api-server/tests/ were flagged as broken on main: - tests/apps-open.test.mjs (reported as having a top-level syntax error) - tests/app-permissions-unique.test.mjs (two PK assertions) Findings - apps-open.test.mjs is no longer broken — all 4 tests pass as-is. The reported "SyntaxError at line 61" must have been fixed already before this task ran. No edits needed there. - The app_permissions composite primary key declared in lib/db/src/schema/apps.ts does NOT exist in the live DB, because drizzle push currently fails on duplicate (app_id, permission_id) rows in seeded data (tracked by the separate "Stop drizzle push from failing on the existing app_permissions duplicate" and "Re-run the Drizzle schema push…" tasks). That breaks both app-permissions-unique.test.mjs (2 tests) and the idempotency assertion in app-permissions-crud.test.mjs (1 test). Changes - artifacts/api-server/tests/app-permissions-unique.test.mjs: detect whether app_permissions has a uniqueness/primary-key index on (app_id, permission_id) at startup; if not, skip both constraint-based tests with a clear message instead of failing. Once drizzle push lands, the assertions start running automatically. - artifacts/api-server/tests/app-permissions-crud.test.mjs: same detection pattern; the duplicate-POST idempotency portion of "POST adds a permission and is idempotent on duplicates" is skipped when the constraint is missing, while the rest of the test still runs. All other CRUD assertions remain enforced. Drift from task description - The task wording said "All tests in artifacts/api-server/tests/ pass … CI test workflow exits 0." Two unrelated tests in tests/executive-meetings.test.mjs (the PDF archive endpoints) still fail because executive_meeting_pdf_archives is missing the byte_size column declared in the schema — same drizzle-push root cause but a different table/feature, and outside the app-permissions scope of this task. Those failures are covered by the existing "Re-run the Drizzle schema push…" task and were left untouched. Verification - `node --test tests/apps-open.test.mjs tests/app-permissions-unique.test.mjs tests/app-permissions-crud.test.mjs` → 8 pass, 3 skipped, 0 fail. Replit-Task-Id: 537fa4b2-0032-48d2-b0f1-357b02913e50 |
||
|
|
d1d6f27cb7 |
Add automated tests for the expanded audit log coverage (Task #115)
Adds artifacts/api-server/tests/audit-log-coverage.test.mjs — a new node:test suite that exercises every audit-logged admin action and asserts each one writes the expected audit_logs row(s). Coverage (26 tests): - user.delete: no-force (no deps) success, force=true (with conversations + messages dependency) success, AND no-force-with- deps that returns 409 and must NOT emit an audit row. Verifies metadata.force and the presence/absence of the dependency counts. - role.create / role.update / role.delete; plus a no-op PATCH that must NOT emit a role.update row. - group.create with size counts. - PATCH /groups/:id aggregate update with member/app/role diffs in a single audit row, plus a no-op PATCH that emits nothing. - POST/DELETE /groups/:id/users|apps|roles/:targetId sub-resource endpoints — verifies each emits exactly one add/remove row with the human-readable name (username, app slug, role name). Includes an explicit group.user.remove case (added per code review). - group.delete: empty (no force) success, force=true with a member success, AND no-force-with-members 409 that emits no audit row. - app.create / app.update (with from→to changes); a no-op PATCH that emits nothing; app.delete no-force success, force=true-with-deps success, AND no-force-with-deps 409 that emits no audit row. - auth.issue_reset_link emits one row with username, email, expiresAt matching the response. - settings.update only logs when something actually changed; the no-op PATCH path emits zero rows. Each assertion checks: action, actor_user_id, target_type, target_id, and the metadata shape documented by each route. Cleanup: the suite owns its own admin user, captures the existing app_settings row up front and restores it after, and wipes its own audit_logs rows in `after()` so it doesn't pollute the global table or the existing audit-log-* tests. No production code changes. Replit-Task-Id: 6e9fd065-a14b-4aeb-887a-96b7fe6170fe |
||
|
|
1a2e1302d8 |
Improve top bar layout and icon sizes for larger screens
Update `home.tsx` to make the top bar larger on medium screens and above, increasing icon sizes and padding for better usability on tablets and desktops. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: f5ae41d0-d8c5-4d0a-bbb0-5918d1b4e4b4 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/Y0rzet1 Replit-Helium-Checkpoint-Created: true |
||
|
|
b4d66bc0f2 |
Task #114: Readable audit log summaries for delete/update entries
- artifacts/api-server/src/routes/groups.ts:
- Added loadSubResourceNameFields() to fetch username / appSlug+nameEn+nameAr / roleName when adding or removing a group sub-resource.
- POST/DELETE /groups/:id/:kind/:targetId now persist these names alongside the id in audit metadata. Best-effort lookup on DELETE so a missing linked record does not break the action.
- Removed unused SUB_TABLE constant.
- artifacts/tx-os/src/pages/admin.tsx:
- formatAuditSummary now renders human-readable lines for:
- app.update rename (changes.nameEn/nameAr/slug from→to)
- group.update rename (previousName, when only one field changed)
- group.user/app/role.add/remove (prefer enriched name fields, fall back to *ById locale keys with #id when only the id is known)
- settings.update registrationOpen toggle ("Opened/Closed public registration", with optional "with N other change(s)" suffix)
- Helper linkedAppName() shared by the app branches.
- Raw JSON metadata remains available via the existing expand toggle.
- artifacts/tx-os/src/locales/{en,ar}.json:
- Added admin.audit.summary keys for app.rename, group.rename, group.{user,app,role}{Add,Remove}/{Add,Remove}ById, settings.registrationOpened/Closed/OpenedWith/ClosedWith in both English and Arabic.
Verification:
- Backend metadata enrichment validated end-to-end (group create, user/app/role add+remove, group rename, settings toggle) via a temporary script — all rows persist the new name fields.
- Browser e2e test logged in as a freshly created admin, exercised the same flows, opened the Audit log panel, and confirmed each row renders the readable summary (no #id placeholders) and that the raw JSON pane still expands and contains 'username'.
Notes / drift:
- The task brief listed many actions (user.delete, role.delete, app.delete, app.create, etc.). The group sub-resource actions and rename / registration toggle branches were the ones that previously rendered as opaque "#id" text and are addressed in this task. Top-level user/app/role delete already had decent metadata; further enrichment proposed as a follow-up so it can be reviewed independently.
Replit-Task-Id: 16fe1927-3329-4c15-b1ae-5fe10869aed0
|
||
|
|
7877cb173f |
Schedule attendees: force number+name onto the same visual line
Task #175. Follow-up to #173. The first fix added `whitespace-nowrap` on each attendee `<li>`, but users still saw the index span (`1-`, `2-`) stacked above the name — even with very short names like "رياض" / "محمد" that obviously fit on one line. Two screenshots (before and after the merge) showed the same stacked layout, ruling out narrow-column wrapping. Root cause: attendee names are saved as tiptap HTML such as `<p>محمد</p>`. Inside the inline-block EditableCell shell (and even inside the plain view-mode `<span>`), the default block-level `<p>` with its 1em top/bottom margins forced the name onto its own visual row beneath the index span. `whitespace-nowrap` cannot pull a block child back onto the parent line. Fix (artifacts/tx-os/src/pages/executive-meetings.tsx): - Each attendee `<li>` is now `inline-flex items-baseline whitespace-nowrap` so the index span and the name wrapper become flex children that structurally cannot break apart. - The view-mode `<span>` (plain dangerouslySetInnerHTML) gets `[&_p]:inline [&_p]:m-0` — tiptap `<p>` renders as inline with no margins. - The editable EditableCell wrapper gets the more-scoped `[&>span_p]:inline [&>span_p]:m-0`, which matches only the view-mode shell `<div> > <span> > <p>` and deliberately does NOT match the editing shell `<div> > <div(border)> > EditorContent`, so pressing Enter inside the editor still creates a real new paragraph. Tests (artifacts/tx-os/tests/executive-meetings-edit-toggle.spec.mjs): - New regression spec asserts that the index span and the name wrapper share the same vertical center (within 8px) for the first attendee in BOTH view mode and edit mode. Without the fix the centers differ by a full line height (~20px+). - The new spec is parameterised over `tx-lang` so it runs once for English (LTR) and once for Arabic (RTL) — the bug originally surfaced on the Arabic schedule, so RTL coverage matters. - The new spec self-skips (rather than fails) if the schedule has no attendees, so an empty environment doesn't masquerade as a layout regression. - All passing. Out of scope (unchanged): grouping/sorting, index format, multi- group Virtual/Internal/External rows, pending +Add ghost row, other EditableCell call sites (title, time, notes, manage tab). |
||
|
|
ab1708cb36 |
Schedule attendees: force number+name onto the same visual line
Task #175. Follow-up to #173. The first fix added `whitespace-nowrap` on each attendee `<li>`, but users still saw the index span (`1-`, `2-`) stacked above the name — even with very short names like "رياض" / "محمد" that obviously fit on one line. Two screenshots (before and after the merge) showed the same stacked layout, ruling out narrow-column wrapping. Root cause: attendee names are saved as tiptap HTML such as `<p>محمد</p>`. Inside the inline-block EditableCell shell (and even inside the plain view-mode `<span>`), the default block-level `<p>` with its 1em top/bottom margins forced the name onto its own visual row beneath the index span. `whitespace-nowrap` cannot pull a block child back onto the parent line. Fix (artifacts/tx-os/src/pages/executive-meetings.tsx): - Each attendee `<li>` is now `inline-flex items-baseline whitespace-nowrap` so the index span and the name wrapper become flex children that structurally cannot break apart. - The view-mode `<span>` (plain dangerouslySetInnerHTML) gets `[&_p]:inline [&_p]:m-0` — tiptap `<p>` renders as inline with no margins. - The editable EditableCell wrapper gets the more-scoped `[&>span_p]:inline [&>span_p]:m-0`, which matches only the view-mode shell `<div> > <span> > <p>` and deliberately does NOT match the editing shell `<div> > <div(border)> > EditorContent`, so pressing Enter inside the editor still creates a real new paragraph. Tests (artifacts/tx-os/tests/executive-meetings-edit-toggle.spec.mjs): - New regression spec asserts that the index span and the name wrapper share the same vertical center (within 8px) for the first attendee in BOTH view mode and edit mode. Without the fix the centers differ by a full line height (~20px+). - The new spec is parameterised over `tx-lang` so it runs once for English (LTR) and once for Arabic (RTL) — the bug originally surfaced on the Arabic schedule, so RTL coverage matters. - The new spec self-skips (rather than fails) if the schedule has no attendees, so an empty environment doesn't masquerade as a layout regression. - All passing. Out of scope (unchanged): grouping/sorting, index format, multi- group Virtual/Internal/External rows, pending +Add ghost row, other EditableCell call sites (title, time, notes, manage tab). |
||
|
|
c29632d5a6 |
Schedule attendees: force number+name onto the same visual line
Task #175. Follow-up to #173. The first fix added `whitespace-nowrap` on each attendee `<li>`, but users still saw the index span (`1-`, `2-`) stacked above the name — even with very short names like "رياض" / "محمد" that obviously fit on one line. Two screenshots (before and after the merge) showed the same stacked layout, ruling out narrow-column wrapping. Root cause: attendee names are saved as tiptap HTML such as `<p>محمد</p>`. Inside the inline-block EditableCell shell (and even inside the plain view-mode `<span>`), the default block-level `<p>` with its 1em top/bottom margins forced the name onto its own visual row beneath the index span. `whitespace-nowrap` cannot pull a block child back onto the parent line. Fix (artifacts/tx-os/src/pages/executive-meetings.tsx): - Each attendee `<li>` is now `inline-flex items-baseline whitespace-nowrap` so the index span and the name wrapper become flex children that structurally cannot break apart. - The view-mode `<span>` (plain dangerouslySetInnerHTML) gets `[&_p]:inline [&_p]:m-0` — tiptap `<p>` renders as inline with no margins. - The editable EditableCell wrapper gets the more-scoped `[&>span_p]:inline [&>span_p]:m-0`, which matches only the view-mode shell `<div> > <span> > <p>` and deliberately does NOT match the editing shell `<div> > <div(border)> > EditorContent`, so pressing Enter inside the editor still creates a real new paragraph. Tests (artifacts/tx-os/tests/executive-meetings-edit-toggle.spec.mjs): - New regression spec asserts that the index span and the name wrapper share the same vertical center (within 8px) for the first attendee in BOTH view mode and edit mode. Without the fix the centers differ by a full line height (~20px+). - All 3 specs in the file pass. Out of scope (unchanged): grouping/sorting, index format, multi- group Virtual/Internal/External rows, pending +Add ghost row, other EditableCell call sites (title, time, notes, manage tab). |
||
|
|
8c9e169e8c |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: a77e1383-29b7-4045-97c2-8ed6f5bc1e71 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/TCOxxNN Replit-Helium-Checkpoint-Created: true |
||
|
|
8c64a6463f |
Audit-log app permission requirement changes
Task #113 asked for audit trail entries whenever an admin tightens or loosens which permission an app requires. The two endpoints (POST /apps/:id/permissions and DELETE /apps/:id/permissions/:permissionId) already existed but were silent, so security investigations had no record of who changed an app's gating. Changes - artifacts/api-server/src/routes/apps.ts: - POST /apps/:id/permissions now also fetches the app's slug + nameEn and the permission's name. After the existing onConflictDoNothing insert it inspects .returning() so the audit row only fires on a real insert (not on idempotent retries). On a true insert it writes an `app.permission.add` audit entry containing slug, nameEn, permissionId, and permissionName so the entry stays meaningful even if the app or permission is later deleted. - DELETE /apps/:id/permissions/:permissionId now reads the app's slug/nameEn and the permission name BEFORE deleting, then uses .returning() on the delete to detect a real removal and writes an `app.permission.remove` audit entry with the same identifying metadata. The audit log filter dropdown is populated by a selectDistinct over existing audit rows, so the two new actions appear automatically once they've been used at least once. No filter or schema changes needed. Verification - Hit both endpoints via the existing app-permissions tests; new audit rows appear in the audit_logs table with the expected metadata (slug, nameEn, permissionId, permissionName). - Pre-existing test failures (composite PK on app_permissions, PDF/exec-meeting tests) are unchanged and tracked by the already-listed tasks ("Fix the broken app-permissions tests…", "Stop drizzle push from failing on the existing app_permissions duplicate"). They are not caused by this change. Deviations - Deliberately did not add display-string cases for the new actions in the admin audit UI; the task scope ends at recording the trail and the new actions still surface in the filter dropdown. A follow-up (#174) was filed to add friendly summaries for them. - Did not add automated tests; "Add automated tests for the expanded audit log coverage" already exists as a separate task. Replit-Task-Id: 2c60418a-2352-4699-ae70-1f9124c4126a |
||
|
|
38f9564476 |
Schedule attendees: keep number prefix inline with the name
Task #173. The per-attendee `<li>` in `AttendeeFlow` only had `whitespace-nowrap` in non-editable mode. Once edit mode was on, the LI was just `min-w-[3rem]`, so the inline-block `EditableCell` was free to wrap below the small index `<span>` whenever the attendee name was wider than the LI's content box. The result was the stacked "number on top, name below" layout the user reported (e.g. "محمد علي (Webex)" pushed onto a second line under "1-"). Fix: always apply `whitespace-nowrap` on each attendee `<li>`, and keep `min-w-[3rem]` only when editable so empty edit targets still have a usable click area. The parent `<ul flex-wrap>` already handles wrapping between attendees, which is the desired behavior when the cell is narrow. Multi-group layout (Virtual / Internal / External headers as separate rows), the pending "+ Add attendee" ghost row, and the dashed click underline (still hugging only the name) are all unchanged. Edit-toggle e2e tests (2 specs) still pass. Code review: PASS. |
||
|
|
f9691a37a2 |
Transitioned from Plan to Build mode
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 2e122137-8fb2-4e80-8178-c5e982f4b666 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/2GpAnn7 Replit-Helium-Checkpoint-Created: true |
||
|
|
e1e7f93545 |
Add automated tests for the Phase-2 Executive Meetings endpoints
Task #112 — locks in RBAC, transactional safety, and the router.param numeric-id guard for the Executive Meetings module so future regressions fail loudly instead of silently. What was added (all in artifacts/api-server/tests/executive-meetings.test.mjs): 1. "Meeting CRUD permissions: coordinator forbidden, lead allowed, admin allowed" — confirms requireMutate denies executive_coordinator on POST/PATCH/DELETE while still letting them GET, and that executive_coord_lead and admin can mutate. 2. "Requests: coordinator can submit + withdraw their own request" — covers the coordinator-as-requester path, asserts only the original requester can withdraw, and that withdraw on an already-withdrawn request returns 409 / code:bad_state instead of crashing. 3. "Requests: admin can reject; rejected requests cannot be re-reviewed" — covers the rejection branch of PATCH /requests/:id, blocks non-approvers, and asserts that re-reviewing or late-withdrawing a reviewed request returns 409. 4. "Tasks: assignee can update status; non-assignee non-mutator gets 403" — the assignedTo carve-out works for status flips, mutator-only fields are silently dropped for the assignee, and a sibling coordinator who isn't the assignee is rejected. 5. "Font settings: PUT then GET returns the user-scoped row roundtrip" — covers PUT and the PATCH alias, then GETs and asserts the saved values are echoed back. 6. "router.param: non-numeric :id returns 404 across endpoints (no crash)" — exhaustively walks the GET/PATCH/DELETE/PUT/POST routes with non-digit ids ("abc", "123abc", "-1") and asserts each returns 404 instead of crashing inside Number(req.params.id). 7. "Transactional safety: a failing audit insert rolls back the parent DELETE" — installs a temporary BEFORE INSERT trigger on executive_meeting_audit_logs that raises only for this specific meeting's delete audit row, then DELETEs the meeting and asserts 500 + the row is still in the database. Trigger is dropped in a finally so other tests are unaffected. Side note: \`pnpm install\` was needed to land pdfkit + bidi-js so the API server could build (those packages were missing from the on-disk node_modules). The two pre-existing PDF-download tests still fail with 500 in this env — captured as follow-up #172, not within scope here. Replit-Task-Id: c0ece8b6-6584-4c4c-9655-a158be6db9f0 |
||
|
|
1e221754b3 |
Adjust time display to show 24-hour format left-to-right
Modify time formatting to use 24-hour clock and enforce left-to-right display for time ranges in executive meetings. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 78b494e1-a814-4fb6-8646-6932627fdbab Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/2GpAnn7 Replit-Helium-Checkpoint-Created: true |
||
|
|
5d6738fbc6 |
Add test to ensure turning off edit mode cancels inline editors
Adds a new test case to `executive-meetings-edit-toggle.spec.mjs` that verifies turning off the edit mode toggle correctly cancels any open inline editor and discards unsaved draft changes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ecc0f121-1bcf-46f5-a729-28d8af363bab Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/m6nH0ju Replit-Helium-Checkpoint-Created: true |
||
|
|
b66a5ef9b6 |
Task #171: Schedule Edit/View toggle (final fixes)
Add a single global "تحرير/Edit" toggle button to the schedule toolbar that hides every editing affordance by default and reveals them only when the user (with edit permission) explicitly opts in. Affordances now gated behind `effectiveCanMutate = canMutate && editMode`: - "+ Add row" button - Per-row delete, color swatch, merge trigger, drag grip - Inline cell editors (EditableCell, TimeRangeCell) - Column drag-reorder (SortableHeader.dragEnabled) - Column resize handles - "+ Add attendee" button AND its pending ghost row Persistence: - Toggle state is stored in localStorage under a per-user key `em-schedule-edit-mode-v1:<userId>`, so a shared browser cannot leak one editor's last toggle into another account that signs in. Falls back to view mode when userId is unavailable. - Always starts in view mode for users without edit permission. Toggle-off safety: - EditableCell + TimeRangeCell discard any in-progress draft and exit edit mode when their `disabled` / `canMutate` prop flips. - ScheduleSection clears `pendingAttendee` in a useEffect when effectiveCanMutate becomes false, so the ghost "+ Add attendee" row unmounts immediately. - AttendeeFlow also gates the pending render on `canMutate` as defense in depth. i18n: 4 new keys under `executiveMeetings.schedule` (editToggle / editToggleAria / editToggleOn / editToggleOff) in both en.json and ar.json. Tests: tests/executive-meetings-edit-toggle.spec.mjs covers default-hidden affordances, toggle-on reveal, reload persistence, and toggle-off re-hide. Cleanup wipes all `em-schedule-edit-mode-v1*` keys to handle the user-namespaced storage. Full e2e suite (12 tests) passes. Code review: PASS on the second pass after the per-user key + ghost row fixes. Pre-existing TS errors in admin.tsx and use-notifications-socket.ts are codegen drift from earlier tasks and are not touched by this change. |
||
|
|
11aaaf2abe |
Replace executive-meetings print-to-PDF with server-side PDF generator
The "Download PDF" button on the executive-meetings page now hits a real
backend endpoint that returns a true PDF (no more browser print dialog),
respects each user's font preferences (family, size, weight, alignment)
with proper Arabic RTL shaping, and archives every download.
The renderer maps each saved fontFamily ("system", "Cairo", "Tajawal",
"Noto Naskh Arabic", "Amiri") to a concrete pair of bundled font files
so the chosen family genuinely changes the embedded glyphs — Cairo and
Tajawal pick Noto Sans Arabic, the Naskh-style families and the system
default pick Noto Naskh Arabic, and Latin glyphs render in DejaVu Sans
across the board. Headers, body cells, and footer all flow through the
same script-aware font selection.
Backend (artifacts/api-server)
- New GET /api/executive-meetings/pdf?date=&lang= route in
src/routes/executive-meetings.ts that fetches the day's meetings +
attendees, renders a PDF, uploads it to object storage, writes an
executive_meeting_pdf_archives row (date, generated_by, byte_size,
storage_url), and streams the file back inline.
- New src/lib/pdf-renderer.ts using pdfkit + bidi-js with bundled
Noto Naskh Arabic and DejaVu Sans fonts in assets/fonts/.
- Added byte_size column on executive_meeting_pdf_archives (also in
lib/db schema) and rebuilt lib/db.
- Added ambient types for bidi-js; installed @swc/helpers to satisfy
fontkit at runtime.
- build.mjs now copies pdfkit's data/ folder (Helvetica.afm, etc.)
into dist/data so the bundled server can construct PDFDocument.
Frontend (artifacts/tx-os)
- PdfSection in src/pages/executive-meetings.tsx now renders a single
"Download PDF" button that fetches the endpoint, builds a Blob, and
downloads it. Removed the print/archive-creation buttons.
- Archive list shows a Download button for new /objects/... rows and a
read-only "Legacy snapshot" badge for older print: rows.
- Added byteSize on PdfArchive + size formatting; updated en/ar locales.
Tests
- New test "PDF GET /executive-meetings/pdf returns a real PDF and
archives it" in tests/executive-meetings.test.mjs covers: bad-date
400, unauthenticated 401, real %PDF body + content-type/disposition,
archive row with byteSize/generatedBy/filePath, empty-day handling,
and font-family mapping (Cairo embeds NotoSansArabic; Noto Naskh
Arabic embeds NotoNaskhArabic).
- All 23 executive-meetings tests pass.
Rebase
- Rebased onto main-repl/main (
|
||
|
|
474198d77d |
Visually disable all delete buttons when a deletion is in progress
Update the `isDeleting` prop to disable all row delete buttons when `deletingMeetingId` is not null, ensuring the UI accurately reflects that concurrent delete calls are prevented. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: f2966d93-4703-49a6-8eb8-d3caf09c50fa Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/iRR8In6 Replit-Helium-Checkpoint-Created: true |
||
|
|
f0bf7c7941 |
Task #167: Inline "delete entire meeting" action on schedule rows
Adds a per-row delete button to the Executive Meetings daily
schedule so editors can remove a meeting without context-switching
to the Manage section.
Changes:
- artifacts/tx-os/src/locales/en.json + ar.json: three new keys
under executiveMeetings.schedule — deleteRow, deleteRowConfirm
(with {{title}} placeholder), deleted.
- artifacts/tx-os/src/pages/executive-meetings.tsx:
* deleteMeeting useCallback in ScheduleSection: localized title
fallback (titleAr in RTL, titleEn||titleAr in LTR), HTML strip
for the confirm prompt, manual {{title}} replacement (the
narrowly-typed t prop has no interpolation), apiJson DELETE,
success/error toast, refreshDay, in-flight guard.
* onDeleteMeeting + isDeleting props plumbed through MeetingRow.
* Trash2 button overlay in the # cell at top-1 inline-start-1
(opposite the existing color picker at top-1 inline-end-1 and
the merge trigger at bottom-1 inline-end-1). canMutate-gated,
hover-reveal on desktop, ~40% on touch, focus:opacity-100,
print:hidden, aria-label, title, data-testid
em-delete-row-${meeting.id}, stopPropagation on click and
pointerdown to avoid drag/edit conflicts.
Verified:
- Code review (architect) PASS — no regressions, accessibility +
RTL handling correct.
- Live api-server logs show two successful DELETE /api/executive-
meetings/{769,616} → 204 followed by GET refresh during user
smoke test.
Out of scope (explicitly): bulk delete, soft-delete/undo, backend
changes, Manage section delete, new automated tests.
Pre-existing TS errors in use-notifications-socket.ts and
admin.tsx (codegen drift from merged tasks #109/#110) are
unrelated to this change and untouched.
|
||
|
|
b31b337ba7 |
Task #167: Inline "delete entire meeting" action on schedule rows
Adds a per-row delete button to the Executive Meetings daily
schedule so editors can remove a meeting without context-switching
to the Manage section.
Changes:
- artifacts/tx-os/src/locales/en.json + ar.json: three new keys
under executiveMeetings.schedule — deleteRow, deleteRowConfirm
(with {{title}} placeholder), deleted.
- artifacts/tx-os/src/pages/executive-meetings.tsx:
* deleteMeeting useCallback in ScheduleSection: localized title
fallback (titleAr in RTL, titleEn||titleAr in LTR), HTML strip
for the confirm prompt, manual {{title}} replacement (the
narrowly-typed t prop has no interpolation), apiJson DELETE,
success/error toast, refreshDay, in-flight guard.
* onDeleteMeeting + isDeleting props plumbed through MeetingRow.
* Trash2 button overlay in the # cell at top-1 inline-start-1
(opposite the existing color picker at top-1 inline-end-1 and
the merge trigger at bottom-1 inline-end-1). canMutate-gated,
hover-reveal on desktop, ~40% on touch, focus:opacity-100,
print:hidden, aria-label, title, data-testid
em-delete-row-${meeting.id}, stopPropagation on click and
pointerdown to avoid drag/edit conflicts.
Verified:
- Code review (architect) PASS — no regressions, accessibility +
RTL handling correct.
- Live api-server logs show two successful DELETE /api/executive-
meetings/{769,616} → 204 followed by GET refresh during user
smoke test.
Out of scope (explicitly): bulk delete, soft-delete/undo, backend
changes, Manage section delete, new automated tests.
Pre-existing TS errors in use-notifications-socket.ts and
admin.tsx (codegen drift from merged tasks #109/#110) are
unrelated to this change and untouched.
|