Skip to content

Bell and Task History PR Review

Ed Mozley edited this page Dec 1, 2026 · 1 revision

Notification bell and task history API - PR review (#455, #457)

Two pull requests from @cloudcogsio, both built as agreed in their issues and merged on 1 December 2026 for 5.15.0.

PR What it does Verdict
#455 The notification bell stays open while you clear notifications one by one, with a button to jump to the end of a long list (#439) Merged, then one polish commit on top
#457 REST API: GET /tasks/{id}/history (#438) Merged as sent

#455 - the notification bell

The problem. Clearing a notification asks for confirmation, and the bell's "click outside closes the panel" handler counted a click on that confirmation as outside. So every clear closed the bell, and working down a list of twenty meant opening it twenty times.

What the PR does.

  • The click-outside handler ignores clicks inside the shared confirmation dialog (.fitsm-confirm-overlay), so Clear and Cancel leave the bell open. Clearing the last notification closes it, since nothing is left.
  • An open "why is this here?" box goes with its row.
  • A round Jump to the end button floats at the bottom of a list that scrolls, and turns into Back to the top at the end. It is centred so it never covers a row's buttons, and its wrapper is position: sticky with no height, so it adds no space under the list.
  • Both bells get it - the analyst one and the self-service portal's - because they share assets/js/notification-bell.js.

Why merged. It does exactly what #439 agreed, in the shared file both bells use, with theme tokens only (the colour guard's count did not move) and the cache-busters bumped. Nothing in it needed changing.

Why a polish commit on top. Two things only a keyboard or a motion setting would show:

  1. Focus after a clear. The cleared row had the keyboard focus; when it was removed, focus fell to the page, and a keyboard user started again from the top. Focus now moves to the next row's clear button, or back to the bell when the list is empty:

    const after = (hadExplain ? ex : item).nextElementSibling;
    ...
    const next = after && after.classList.contains('nb-item') ? after : list.querySelector('.nb-item');
    const target = next && (next.querySelector('.nb-clear') || next);
    if (target && typeof target.focus === 'function') target.focus();
  2. Reduced motion. The jump scrolled smoothly even for someone who has asked their computer for less motion:

    const still = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    panel.scrollTo({ top: jump.classList.contains('up') ? 0 : panel.scrollHeight, behavior: still ? 'auto' : 'smooth' });

Files: assets/js/notification-bell.js, assets/css/notification-bell.css, includes/notification_bell.php, lang/en/common.php (jump_end, jump_top). User page: Notifications. Developer guide: Notifications - Developer Guide.

#457 - a task's history over the REST API

The gap. Tickets, problems, changes, assets, domains and projects each had a history or audit endpoint; tasks did not, so an integration could not read what the task window's History tab shows.

What the PR does. GET /api/v1/tasks/{id}/history, newest first.

  • One reader. The handler calls TaskHistory::forTask() - the same function the History tab uses - and nothing else, so anything the History tab learns to show (the #430 entries, and whatever is recorded later) comes through the API with no code of its own.
  • Its own permission, task_history.read, mapped to the Tasks module. Existing keys do not get it until somebody ticks it.
  • Company scope through apiLoadTask(): a task outside the key's companies is a 404, the same as one that does not exist.
  • Checklist steps only for checklist readers. A step entry carries the step's result and values, which GET /tasks/{id}/checklists guards, so they are included only when the key also has task_checklists.read and Checklists is switched on.
  • at is ISO 8601 UTC like every other endpoint, and detail is always an object, so a client can always read keys from it.
  • The OpenAPI document (api/v1/spec.json, openapi_schemas.php) and the Tasks help both describe it; tests/api-task-history.php covers it.

Why merged as sent. One reader for the screen and the API, a permission of its own like the ticket, problem and change audit endpoints, the company check through the existing loader, and the sensitive checklist data held back behind the permission that already guards it. The tests (52 of 52) and the OpenAPI check passed. There was nothing to change.

User page: REST API: Tasks - History.

See also

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally