Skip to content

Calendar page: cards by due date across your projects, with saved calendars - #9

Merged
ThomasLohner merged 22 commits into
ScaleCommerce-dev:mainfrom
iz-scale:feature/redaktionsplan
Nov 19, 2026
Merged

ThomasLohner merged 22 commits into
ScaleCommerce-dev:mainfrom
iz-scale:feature/redaktionsplan

Conversation

@iz-scale

@iz-scale iz-scale commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Reworked after the review below: no more board type inside a project. This is now a global Calendar page beside My Tasks, with a month calendar and a week view.

Why

Our marketing team needs a shared view of what gets published when: social media posts, newsletters and LinkedIn events. Those cards belong to the projects they are about (each event has its own posts, VideoOptimizer has its own), so they live in many projects and often as sub-tasks. We tag them Redaktionsplan and need one place that shows them by day, for the whole team, also when someone is out. Other teams can use the same page with their own tags, for example per project.

What it does

  • Calendar in the sidebar after My Tasks, outside any project. It shows cards with a due date from the projects you are a member of (not admin-elevated). The description says how many projects that is, so two people can tell why they see different cards.
  • Week (tall days with ticket, project and assignee) and Month (weeks as rows, compact chips, "+N more" opens that week). Today / previous / next.
  • Filters: tag, person, project and status. Tags and statuses match by name, case-insensitively, since each project has its own ids. A sub-task appears only when it carries the tag itself. Filters are in the address (/calendar?tags=Redaktionsplan&mode=month).
  • Drag a chip to another day to change its due date. Click to open the normal card panel with the card's own project's statuses, people and tags.
  • No date (X): with a tag chosen, its undated cards fold out below.
  • Saved calendars: "Save as…" stores the filters under a name (e.g. "Redaktionskalender"), listed in the sidebar under Calendars at /calendar/:id. They are personal, like stars. Changing a saved calendar's filters saves them right away (no Save/Cancel). Copy link shares the filters as a /calendar?… link that anyone can open on their own projects and save. Rename and delete are there too.

How

  • GET /api/calendar?from&to&tags&people&projects&statuses (server/utils/calendar-cards.ts):
    • Returns cards due in the window (at most 62 days) from the caller's member projects, plus each filter's choices.
    • With a tag, the query goes tags by project → card_tags by tag (existing index) → cards by key. Without a tag, it reads cards by project and due date within the window.
    • Expired done cards are left out by the usual retention. Each card names its parent and the first board showing its status.
  • shared/utils/calendar-filter.ts is the one filter rule. The server answers with it, and the page applies it to live updates.
  • calendars table (migration 0021_calendars, user_id cascade) and /api/calendars GET / POST / PUT / DELETE. Another person's calendar is a 404.
  • /api/events?scope=mine streams every project the caller is a member of and re-checks membership per event.
  • Live updates patch only the changed card: it is tested against the filters and the window, then enters, moves or leaves. Only view.invalidate re-reads the page.
  • app/utils/calendar-days.ts: Monday weeks, month grids in whole weeks, and titles. A card's day is its stored UTC date, while today is the viewer's local date; both are compared as YYYY-MM-DD.

From your review this addresses: no project owns cross-project content, nothing disappears with a project, the empty Gantt layout is replaced by a calendar, no Save/Cancel on existing things, per-card live updates instead of full reloads, and the different-viewers point is stated on the page. Tag names are still matched by name, which is what lets one filter span projects. A renamed tag simply shows under its new name in the tag picker.

Tests

  • Integration tests/integration/calendar.test.ts (12):
    • A tagged card in project A and a tagged sub-task in B both appear, with project and parent.
    • An untagged sub-task of a tagged parent stays out, and so do cards outside the window.
    • Undated cards are listed only when a tag is chosen.
    • Without a tag, every card due in the window is shown.
    • Filters by person, project and status name work.
    • Nobody sees projects they are not in.
    • Tag names are offered once.
    • A due-date change moves the card and removing the tag drops it.
    • The window is validated.
    • Saved calendars: CRUD, they stay private (404), and the filter shape is validated.
  • Unit:
    • calendar-days.test.ts: time zones, DST, Monday weeks, 5- and 6-week months, titles across months and years.
    • calendar-filter.test.ts.
  • pnpm lint and the full pnpm test pass (2057). Checked in the browser:
    • week, month, filters, drag to another day, panel, live update, save / rename / copy link
    • a colleague opening the link sees only their own project's cards

🤖 Generated with Claude Code

@ThomasLohner ThomasLohner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I checked it out and tried it with cards from two projects.

First the good news: you're right that Completo is missing a way to plan by time. Today you can't easily see what is due when. So the idea is good. My concern is mostly about where this feature lives, not about the feature itself.

My main concern: a board in one project shows cards from other projects

In Completo, every board and list belongs to one project and shows that project's cards. This PR breaks that rule: the timeline board lives in project A, but shows cards from all projects the viewer is a member of.

That causes a few problems:

  • Two people see different things on the same board. What you see depends on which other projects you are in. Nobody can tell why their colleague sees more or fewer cards.
  • Project A controls content from other projects. The owner of the board in A picks the tags, and that pulls in cards from projects B and C, where they may have no say.
  • Deleting project A deletes the timeline, even though most of its cards may come from elsewhere.

(No data leaks: you only ever see cards from your own projects. The problem is the concept, not security.)

There are two clean ways to do this

1. Keep it inside one project. For example, a "Content Planning" project that holds all the content cards. Then the timeline is just a normal view of that project, like a board or a list.

2. Make it a global view, outside of projects. This is a bigger change, and it has a catch:

  • Global boards can't work. Each project has its own statuses, so there are no shared columns to put cards in.
  • Global lists, a calendar or a Gantt chart could work, because they don't need columns.
  • Different people will still see different cards, depending on their projects. That needs to be clearly visible.

So a calendar view and/or a Gantt view could make sense as new global pages, next to "My Tasks". Just not as a board type inside a project, the way the PR builds it.

What was the goal?

This decides which way to go:

  • "When do I need to do what?" That's personal. It should be a timeline version of My Tasks, not a board in a project.
  • "How long is this project going to take?" That's a project view, showing only that project's cards.
  • "Put cards from different projects together in one shared view." That's a new, bigger topic (global views, see above), and we should discuss it before building it.

Which one did you have in mind?

The visualization

The current layout has one row per card and one column per day. Each row has exactly one mark, on the due date. Everything else is empty.

With 6 cards over 14 days, only 6 of 84 cells show something. That's 7%. The other 93% is empty space. With more cards it gets worse, not better. To read it, you look along an almost empty row to find the mark, then look back to the left to see which card it was.

This layout (a Gantt chart) is made for tasks that have a start and an end. Our cards only have a due date, so it's the wrong layout for our data.

Some ideas that fit better, to discuss:

  • Month calendar (my favourite to start with): weeks as rows, days as boxes, cards as small chips in their day. Drag a card to another day to change its due date.
  • Agenda list: each day as a heading with its cards below. Days without cards are skipped. Very compact and works well on a phone.
  • Swimlanes: on top of the calendar, one row per project or per person, so you can see "what is due for Anna on Tuesday?".
  • Show gaps and busy days: for content planning it's useful to see "nothing goes out next week" or "four posts on Monday" at a glance.
  • A real Gantt chart: only makes sense if cards get a start date. Then each card is a bar, and the chart fills up. That would be a separate decision.

The "No date" section at the bottom is a good idea. Let's keep it.

Smaller issues

These matter less, and some go away depending on the direction we choose:

  • Wrong card count: on the project page, the timeline board shows the count of project A's cards (15 in my test), not the timeline's (7).
  • Settings have Save and Cancel: elsewhere in Completo, changing something that already exists saves right away, without Save or Cancel.
  • Every card edit reloads the whole timeline: elsewhere we only update the one card that changed.
  • Tags are matched by name: if someone renames the tag in one project, those cards silently disappear from the timeline.
  • Live updates listen to all projects: any card change in any of your projects reloads the timeline.

What's good

No data leaks, done cards are hidden after the usual time, the card opens in the normal card panel, and the tests and API docs are there. A lot of this can be reused, whichever direction we choose.

iz-scale and others added 2 commits November 19, 2026 12:44
Server side of a Calendar page beside My Tasks, outside any project.

- GET /api/calendar?from&to&tags&people&projects&statuses: cards due in the
  window (at most 62 days) from every project the caller is a member of
  (not admin-elevated), passing the filters, plus each filter's choices.
  Tags and statuses match by name, ignoring case, since each project has its
  own; sub-tasks only with their own tag; expired done cards left out. With
  a tag chosen, tagged cards without a due date come back as `undated`.
  Each card names its parent and the first board showing its status.
- The filter rule is shared/utils/calendar-filter.ts, so the page applies
  the same test to live updates.
- calendars table and /api/calendars CRUD: a person's own named filter sets
  (migration 0021). Another person's calendar is a 404.
- /api/events?scope=mine streams every project the caller is a member of,
  re-checking membership per event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What is due when, across your projects: a week or a month, outside any
project, as discussed on ScaleCommerce-dev#9.

- /calendar: seven columns, a week (tall days, ticket, project, assignee)
  or a month (weeks as rows, chips, "+N more" opens that week). Today,
  previous and next, Week / Month. Filters by tag, person, project and
  status, kept in the address so a set-up can be linked as it is.
- A card is a chip in its due day, in its own project's status colour, done
  cards faded, with a tooltip; drag it to another day to set its due date;
  click it to open the ordinary card panel with that project's statuses,
  people and tags.
- With a tag chosen, its undated cards fold out under "No date".
- Save as… stores the filters as a named calendar listed in the sidebar
  under Calendars (/calendar/:id). Changing a saved calendar's filters
  saves them, with no Save button. Copy link shares the filters, Rename,
  Delete.
- Live: one stream over your projects; a changed card is tested with the
  same rule as the server (matchesCalendar) and enters, moves or leaves on
  its own. Only a structural change re-reads the page.
- The page says how many of your projects it covers, so two people can
  tell why they see different cards.

Day arithmetic (Monday weeks, month grids, the card's UTC day against the
viewer's local today) is app/utils/calendar-days.ts, unit-tested across
time zones and the DST change. API documented in openapi.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@iz-scale
iz-scale force-pushed the feature/redaktionsplan branch from 03dfda9 to 03ec746 Compare November 19, 2026 11:52
@iz-scale iz-scale changed the title Timeline boards: cards with a tag, across projects, day by day Calendar page: cards by due date across your projects, with saved calendars Nov 19, 2026
iz-scale and others added 20 commits November 19, 2026 14:05
- Re-read the page after the event stream reconnects; events sent while it
  was down are not replayed.
- A saved calendar waits for the list before saying it does not exist, and
  says when the list failed to load.
- Ad hoc, the filters follow the address on Back, Forward and the sidebar
  link, not only on first load.
- A filter change made just before leaving a saved calendar is stored, not
  dropped with the debounce.
- "+N more" opens that week without rewriting a saved calendar's mode.
- scope=mine checks one membership per event instead of reading them all.
- The tag path selects tagged cards in a subquery rather than an id list
  that grows with the tag's history.
- from/to must be real days: 2026-02-30 is a 400, not 2 March.
- Week titles read "Nov 23 to 29, 2026": UI copy has no en dashes.
- The tag picker keeps each name's first spelling; boards by status come
  from a map; scope=mine is in openapi.json; comments fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tooltip repeated the chip, did not exist on touch, and its fixed
one-line height let three lines spill over the neighbouring days. The
status dot is replaced by the priority edge bar the board uses, so the
bar means the same in both places. Week chips wrap the title to two lines.
A chip carries a title; hovering it now shows status, priority, assignee,
tags, the parent of a sub-task and the start of the description, without
opening the panel. The preview is CardPreview, extracted from the command
palette's CardSearchPreview so a previewed card looks the same in both.

A hover card rather than a tooltip, half a second before it opens, beside
the chip, closed while dragging, and pointer-only. Its placement is a named
constant in menu-placement.ts, since it opens beside rather than below.
The preview drew the ticket ID bold in the primary colour, the only place a
ticket ID is coloured. It names the card and carries no signal, so it now
uses card-id text-muted like the board, panel and lists. Changes the
command palette's search pane and the calendar's hover preview alike.
The "No date" list appeared only with a tag chosen, which read as a bug
with a project, status or person filter, and it could not schedule
anything, since a card could not be dragged from it onto a day.

It is replaced by one quiet line under the calendar, "N more cards match
your filters but have no due date", for every filter, gone at zero. Done
cards are not counted. The API returns undatedIds rather than the cards,
so live updates keep the number exact per card without re-reading.
Statuses were deduplicated by exact spelling while the filter matches
ignoring case, so "In Progress" and "In progress" from two projects were
two entries filtering the same cards. Deduplicated as the server does for
tags: by the matched name, in its first spelling.
Statuses are matched by name across projects, so filtering for "Done"
missed every project whose done status is called something else, such as
"Erledigt". The status filter now folds every project's done status into
one "Done" entry, DONE_STATUS, which matches a card in its own project's
done status by id, the way UNASSIGNED stands for nobody in the people
filter. Other statuses still match by name.

matchesCalendar takes the status as { name, isDone }, required, so no
caller can leave out the done flag and silently lose Done.
As Apple Calendar has it: previous, Today and next are one control, and
the title names the month and year rather than a span of days, which the
grid already names. A week across two months reads "Nov to Dec 2026".
One row of nine controls wrapped wherever the width ran out and left the
filters hanging right under the navigation. Now the first row orients:
the month and year on the left, Week / Month and previous, Today, next
on the right, as Apple Calendar lays them out. The second row holds the
filters, read and wrapped from the left.

The title never truncates; where the row does not fit, the controls move
below it as one block. Today stays enabled on the current period: greyed
out in the middle of the group it read as broken.
… is set

The page had five layers: title, description, month line, a filter line
that wrapped wherever the width ran out, the grid, and a footnote.

- Previous, Today, next, the month and Week / Month read as one phrase on
  the left, in one neutral outline style; the chosen view is solid, since a
  grey fill read as disabled and made the other option look selected.
- The four filter selects sit behind one Filter button with a count, so the
  toolbar is one line at any width: beside the date controls they fitted
  only while nothing was set.
- What is set shows as removable chips under the toolbar, only while set,
  so a filtered or saved calendar says why it shows only these cards.
- The page description and the no-due-date count become one footnote under
  the grid: whose cards these are, and what the grid cannot show.

The month stays in the toolbar rather than the page title, which says
where you are and names a saved calendar.
The page title now reads "Ganz wichtig November 2026", the month muted,
as Apple Calendar heads its page with the month; the toolbar keeps only
controls. The tab title and breadcrumb keep the name alone.

The chips repeating the filters under the toolbar are gone: whoever saved
a calendar knows what it filters, the Filter button's count says that
something is filtered, and one click shows what. Clear moved into the
filter menu.
A plain space at 26px extra-bold made "Ganz wichtig November 2026" read
as one crammed phrase; 8px more sets the month apart as the second part.
The toolbar was sm (32px) under 44px header buttons, which made those look
oversized. The styleguide's dense sm exception covers cards, list cells and
menus, not a toolbar, so the toolbar is now the regular 44px.

A saved calendar's header carried Copy link beside its menu, though neither
is the page's primary action. Copy link now leads the menu, and the header
keeps one icon button.
At the styleguide's 44px minimum the toolbar controls outweighed the
calendar they steer; calendar apps use about 28 to 32px there. The
toolbar is sm again, and the existing 44px row in docs/connect2scale.md
now names the toolbar above a dense work surface, with that reason.
The toolbar sat inside the scrolling body, so it scrolled away under a
page header that stayed; the styleguide keeps a toolbar in place while
the content scrolls. It now uses UiPage's toolbar slot, with the usual
30px above the body.

Days of the neighbouring months were shaded like weekends, so a month's
first and last rows were nearly all grey and where the month began and
ended did not show. Shading now means weekend only; other months' days
are told apart by a dimmed number, the month's own a step stronger.
"Save as…" was the page header's primary action, greyed out on every
visit until a filter was set, which read as broken rather than as "set a
filter first". Saving belongs to filtering, so it now sits beside Filter
as an outline button and appears when there is something to save.

The toolbar's controls are now one height: the Filter count badge made
its button 4px taller, so setting a filter nudged the row down, and the
Week / Month buttons sat a pixel short of the arrows' group.
Save as appeared to the right of Filter in a right-aligned group, which
pushed Filter, the button just used, out from under the pointer. It now
appears on the left, and Filter keeps its place.

The name field's example was the German "Redaktionskalender" in an
English UI; it is now "Content calendar", in the changelog too.
Changing a filter on a saved calendar rewrote it 400ms later, with no
sign that anything was stored, while the same Filter menu on the plain
calendar only changes what is shown. Narrowing "Ganz wichtig" for a
moment changed it for good.

Filters on a saved calendar now apply to what is shown only, and Reset
and Save changes appear beside Filter while they differ from the saved
ones; leaving the page goes back. A deliberate exception to the commit
contract, as Linear and Notion treat saved views, written down where it
is made.
A shared link carries project and person ids. Opened by someone outside
those projects, the calendar came up empty while the filter menu read
"Any" (or showed a raw id) and the Filter count said 1.

Such values are kept, since for someone outside project X "nothing" is
the honest answer to "only project X", but they are now said: the
pickers name them ("A project you are not in"), the footnote and the
filter menu explain that they match nothing, and "Remove it" drops them.

Checked in dark mode: week, month, hover preview, filter menu and Save
changes need nothing further.
…ler's projects

?scope=mine on /api/events had no test. One membership check per event is all
that keeps it from streaming every card row on the instance, to admins too.
@ThomasLohner
ThomasLohner merged commit 2ccbb5d into ScaleCommerce-dev:main Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants