Repository navigation
Conversation
…d tile essentials
…widths Replace the floating edge toggle with app-panel-collapse-button, which finds its parent panel and sits in the column's existing control row: beside refresh in the staff task list, beside the filter button in the student task list, and in the centre tab bars. Panels now hold a minimum width through drag, keyboard resize and restored widths, and the layout shows the list, then comments, as a rail when the page cannot fit every expanded panel, without changing what is remembered.
Swap the native status select for a mat-select that shows each status's circle and colour beside its label, with All statuses first. The filter value, route binding and accessible label are unchanged.
…ow column Outlined buttons drop the grey fill and drop shadow for a token outline, a faint primary wash and a primary icon, in both themes, using the current Material button tokens. The task details card and status card buttons get icons, a 44px touch height, and wrap to full-width rows on a narrow card, and the key dates run down the card when there is no room for one column per date.
…students and staff One resolver decides the target from the event and whether the notification is about the viewer's own project. Staff go to the task inbox or the staff portfolio view, students to the task, its comments, groups, tutorials or portfolio. A deleted target or a unit the viewer no longer has a role in shows a snackbar and stays put. An api that sends no ids still follows the link.
Author
|
Closing: this work is now on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a single resolver that decides where a notification should open, for both students and staff, and wires the notification bell and the full notifications page to call it instead of following the notification's raw link directly.
Stacked PR
The diff shown here is only the range
ui/a11y-audit..ui/notification-links(57 files, +3,618/-1,236), not the whole branch.The stack is a DAG, not a chain. Checked with
git merge-base --is-ancestor:ui/a11y-auditis an ancestor of this branch. Do not merge this before it lands.ui/panel-layoutis also an ancestor of this branch. The merge base isf7b72aa1f, which is that branch's own tip.ui/panel-layoutis not an ancestor ofui/a11y-audit. They are siblings forked fromcc4a834e6.ui/notification-linksis an ancestor ofui/inbox-extension-card, which merges it at78902d4f7.This branch was not cut plainly off
ui/a11y-audit. Its own history carries7972ea62a"Merge branch 'ui/panel-layout' into ui/inbox-extension-card" and3c19fb377"Merge branch 'ui/a11y-audit' into ui/inbox-extension-card", so it sits on the inbox-extension-card integration line after both siblings were already merged there. That is why the shared panel layout work shows up in this range.Merge order that follows from the graph:
theme/status-and-globalsfirst. Thenui/panel-layoutandui/a11y-auditin either order, since neither is an ancestor of the other. One caveat on that pair. Both already containcc4a834e6("Restyle extension request card and add full-screen comments to the task inbox"), which is not ontheme/status-and-globals, so that inbox-extension-card commit lands with whichever of the two merges first. Then this branch. Thenui/inbox-extension-card.What changed and why
Notification routing (the point of this branch)
notification-target.tsis a new pure function,notificationTarget(), that reads a notification'sevent,notificationType,linkand four of the ids now sent alongsidelink(unitId,projectId,studentId,taskDefinitionAbbr) and decides one of four outcomes: a route to navigate to, the old raw link (for an api that hasn't been updated to send ids), "unavailable" (the thing it pointed at is gone), or "none" (nothing to open).studentIdwith the signed in user's id, not by that user's account role. A tutor who is also enrolled as a student elsewhere still lands on the right side depending on whose project the notification is about.students: 'all'in the query params so a unit convenor who doesn't tutor that student isn't filtered out of the list before the row can be selected.notification-open.service.tsis the piece that needs the running app. It callsnotificationTarget(), then for a staff destination checks the signed-in user still holds a role in that unit before navigating (Admin and Auditor skip that check, and that role does come off the account), waiting for unit roles to finish loading first since they load once after sign-in. If the role check fails, or the navigation itself fails or gets refused, it shows a snackbar throughAlertService.errorand leaves the reader where they were, instead of a blank page or/unauthorised.notification-bell.component.tsandnotifications-page.component.tsdrop their directNotificationRouteService.navigate(notification.link)call in favour ofNotificationOpenService.open(notification). Mark-as-read behaviour itself is unchanged. One wiring change worth naming: both used to call navigate only insideif (notification.link), and both now callopen()on every click, because whether there is anywhere to go is the opener's decision. Both specs were updated so a row with no link still expects oneopencall.notification-route.service.tsgets a newnavigateToTarget()next to the existingnavigate(). It's needed becausenavigate()screens its target through an allow-list built for the api's own link shapes, and the staff inbox/portfolio routes built from ids don't match that allow-list.notification.tsandnotification.service.tsadd and map eight id fields:unitId,projectId,studentId,taskDefinitionId,taskDefinitionAbbr,taskId,commentId,groupId. The resolver reads four of them. The other four are mapped and not yet used. They are deliberately left without defaults so an older api sending nothing stays distinguishable from a newer one sending null.portfolio_submitted, gets its own icon and label, separate from the student-facingportfolio_received, so the staff side of a submission reads as a different notification in the list.xPosition="before"andyPosition="below"at every width. Under 600px a media rule also setstransform-origin: top right, a max-width and a width ofcalc(100vw - 16px), so the panel grows from under the bell instead of animating in from where it would have sat before the overlay pushed it back on screen.Shared panel layout (already in this branch's history, extended here)
app-panel-layout/app-panelis a shared component pair for a page built from collapsible, resizable, full-screen-able columns.PanelStateServiceremembers each panel's collapsed state and width per page inlocalStorage, with every read and write wrapped in a try/catch since a private window or a full quota can refuse silently.Subjectstream withauditTime, hand-clamped widths, theCdkDragMoveimports) for this shared layout, and the student project dashboard moves onto it too. Thesplit-pane-resizingbody class is not gone. It moved intopanel.component.ts, which adds and removes it around a drag, andstyles.scssstill carries its rules.app-panel-collapse-button, which finds its parent panel and renders into that panel's own control row. It is placed in four templates: beside Refresh tasks in the staff task list header, beside the filters button in the shared task list, and in the tab rows of the staff inbox dashboard and the student task dashboard. The floating edge toggle it replaces is removed outright, not just repositioned.panel.component.htmlno longer renders.app-panel__edge-toggle, and the panel layout spec asserts it is absent.clamp(). When the page can't fit every expanded panel the layout rails the first collapsible panels in order, the list and then comments, and never writes that over the user's remembered choice.Task list and task dashboard styling
f-unit-task-listis now a themedmat-selectshowing each status's own colour and icon beside its label, with "All statuses" first, in place of the plain browser<select>. The filter value, route binding andaria-labelare unchanged. The old<label>wrapper and its visible "Task status" text were dropped with the native select, so the control is now named by itsaria-labelalone. This component is used by both the student project dashboard and the staff task viewer, and the filter row is not gated on mode, so the picker changes in both.text-formatif-blueto the themedtext-ot-link. It also swaps a separate reset button fromtext-formatif-blue disabled:text-gray-400totext-ot-link disabled:text-ot-muted.src/styles.scssrestyles every outlined button in the app: a token outline over a faint primary wash, primary-coloured icons, a token radius, and no shadow in place of the old grey fill and drop shadow.Smaller, unrelated fixes carried on this branch
ngx-lottieoptions from the component.Deliberately not changed
localStorageexactly as they set them. The layout component's own comment says the same, and a spec covers it.link, unchanged, and nothing had to be backfilled for those. That is the only fallback to the old path. Once the api does send ids, a notification whoseprojectIdis null but which has a link is reported as unavailable, and one with no link at all opens nothing.Testing
No test suite was run for this PR. What follows is the spec coverage that exists in the diff, counted from it.
notification-target.spec.ts(new): 8itblocks plus threeit.eachtables of 7, 3 and 5 rows, 23 cases in all. They cover the student task and comments-pane events, the groups, tutorials and student portfolio routes, the five staff inbox events, the staff portfolio view, the staff fallback to the unit's student list, the deleted-task and deleted-project "unavailable" outcomes, the "never had a page" case and the older-api link fallback.notification-open.service.spec.ts(new): 10 cases, covering the student comments destination, the staff inbox destination, waiting for unit roles to load, the staff role check and the admin bypass, the deleted-target snackbar, navigation refused and navigation failed, the older-api link fallback, and the nothing-to-open case.notification-presentation.spec.ts: 1 new case, for theportfolio_submittedicon, label and tone.panel-layout.component.spec.ts(new): 13 cases for the shared panel layout, covering collapse and expand, the in-content collapse button, the absence of the edge toggle, stacked tabs, resize clamping, a restored width out of range, auto-railing without touching storage, storage keys, storage that throws, stored values of the wrong shape, and full screen with Esc.unit-task-list.component.spec.ts: 1 new case asserting no<select>remains, that themat-options carry the right label andstatus-icon, and that selection callssetStatusFilter.notification-bell.component.spec.tsandnotifications-page.component.spec.ts: existing click-to-open tests rewritten againstNotificationOpenServicein place ofNotificationRouteService, including the no-link row, which now expectsopento be called.project-dashboard.component.spec.tsandproject-dashboard.mobile.spec.ts: existing tests rewritten forfullscreenPanelandapp-panel-layoutmarkup, replacing the oldcommentsFullscreenflag, the.comments-sidebarselector and the comments-breakpoint stub. Two assertions went with that rewrite and are not replaced: the toggle half of the full-screen test, and the "keeps a full-screen chat open when the window narrows" case.Review guidance
Given the size, the actual new decision-making is small.
notification-target.ts(151 lines) andnotification-open.service.ts(91 lines) carry all the new logic. Both are short and side-effect-light, and the two new spec files exercise them, so a logic read plus a skim of the tests should cover them.panel.component.ts(287 lines) andpanel-layout.component.ts(264 lines) are the largest new source files and carry the min-width, resize and auto-rail math.panel-layout.component.spec.tsis larger still at 290 lines. Worth a closer look, though as the Stacked PR note says, most of this arrived through theui/panel-layoutmerge rather than being written on this branch. The commits written here are7f9966acdand8763d0934.notification.tsmodel andnotification.service.tsfield list additions are plain mapping changes, no logic, safe to skim. Four of the eight new fields have no reader yet.Merge order, and what this diff actually contains
Read this before judging the size. The branch history is a diamond, not a line.
theme/status-and-globals(open as #192) forks atcc4a834e6intoui/panel-layoutandui/a11y-audit. Those two rejoin at merge commits7972ea62aand3c19fb377, and this branch is cut after both. So the diff GitHub shows againstui/a11y-auditalso contains the whole ofui/panel-layout, becauseui/a11y-auditdoes not contain it.ui/a11y-audit: 57 files, +3,618 / -1,236.ui/panel-layoutaccounts for 21 files, +1,521 / -653, and is reviewed in its own PR.7972ea62a: 61 files, +1,564 / -227.Merge order: #192, then the panel layout and accessibility PRs in either order, then this one, then the submission and Unit Hub PR last.