- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
8.6 KiB
Design: the All Boards page's URLs
What it is
Every entry of the All Boards left menu has its own URL - the sections, the Archive, Home and every workspace, however deep it is nested. So a section or a workspace can be bookmarked, sent to a colleague, opened in a second tab and reached with the Back button. A workspace is addressed by the slugs of its names down the tree, not by a random id.
Read more
- Uniform Resource Locator and Clean URL - Slug on Wikipedia
- Permalink
- Breadcrumb navigation - the title trail in the header
- limax, the slug library WeKan uses
- Admin Panel URLs and Workspaces in these docs
How to use it
- Open All Boards and click a row of the left menu, or a workspace.
- The browser's address bar now shows that entry's URL, for example
/allboards/workspaces/engineering/backend; copy or bookmark it. - Opening the URL later selects the same entry. Back returns to the entry you had before.
The old addresses /templates and /remaining still work and redirect.
How the numbers are calculated
The URLs have no numbers of their own. Their rules:
- the route is
'/allboards/:section?/:path*', and:path*is zero or more segments, so there is no depth limit; - an unknown section falls back to Starred (
resolveSection(),DEFAULT_SECTIONinmodels/lib/allBoardsUrls.js); - a workspace name that slugifies to nothing uses the workspace id instead;
- of two sibling workspaces with the same slug, the first wins.
How it works in WeKan
Every left-menu entry of All Boards has its own URL — the workspaces tree included.
The page was three addresses: / (Starred), /templates and /remaining. The
workspaces tree had none at all. Which workspace you had open was a ReactiveVar,
so a workspace could not be linked to a colleague, bookmarked, opened in a second
tab or reached with the back button.
The shape
/allboards/starred
/allboards/templates
/allboards/remaining
/allboards/workspaces
/allboards/archive
/allboards/home
/allboards/workspaces/engineering
/allboards/workspaces/engineering/backend
/allboards/workspaces/engineering/front-end/design-system
The route is '/allboards/:section?/:path*'. :path* is zero or more
segments — [^/]+ would stop at the first slash, and a workspace two levels
down would not resolve — so a workspace nests as deep as its tree does.
/ stays the app's home. It names no section, so the page picks one:
Starred when you have starred boards, Remaining when you have none (and,
once per session after login, it first opens your Home board when
one is set).
A workspace is addressed by its names
Not by its id. The id is a random string; a URL should say where you are.
/allboards/workspaces/engineering/backend is a path down the tree, one slug per
level.
The slugs come from getSlug (limax) — the same function that gives a board
its slug in models/boards.js, so a workspace and a board turn a name into a URL
the same way. It is what makes Renkaan Vaihto into renkaan-vaihto and what
handles the scripts where a naive slugifier returns an empty string.
When a name slugifies to nothing anyway — an emoji-only workspace name — the node's id stands in, because a workspace with no address at all could not be opened from a link.
Two sibling workspaces whose names slugify the same are ambiguous, and the first wins. That is the rule a duplicate board slug already follows.
The title bar names the same things
All Boards / Starred, All Boards / Workspaces / Engineering / Backend. The
page is several lists of boards under one name, and a workspace is a tree under one
of them, so "All Boards" alone named the page and not the list you were looking
at.
The section's words are the left menu's own key, so the title and the row highlighted beside it say the same words. A workspace's words are its name, not its slug — the slug is lowercase and hyphenated and is not what the workspace is called — and the name is printed as text rather than translated: it is what a person typed, and a workspace called "starred" is not the Starred section.
The header walks the tree itself, from the URL and from
user.profile.boardWorkspacesTree, which is where the All Boards page reads it
from too. It cannot ask the page: the header is a separate Blaze instance, and
importing a page module from the header once ran it before its own template was
registered, which threw and aborted every module after it.
A trail segment that names nothing stops the walk and the title shows what was still real — a stale link names the part of the path that still exists rather than nothing at all.
This is the same title trail the Admin Panel uses (Admin Panel URLs), one list rather than a helper per segment: the two pages do not have the same number of segments, and a workspace has as many as its tree is deep.
Who resolves what
| The route | resolves the section (an unknown one falls back to Starred), splits the wildcard into slugs, and hands them over in boardListWorkspacePath. |
| The page | resolves the workspace, in an autorun, once its tree has loaded. |
The router cannot resolve the workspace: the tree lives on the user document, which the router has no way to read before the page has it. And it has to be an autorun rather than a one-shot read — a single read always runs before the tree arrives and would never select anything.
A slug path that names nothing leaves the Workspaces section selected, rather than an empty board list.
Clicking a menu row or a workspace does the same thing in reverse: it selects the
entry and then FlowRouter.gos to its URL. go, not replace, so Back returns
to the previous entry — and only when the path would actually change, or every
click becomes a navigation to where you already are.
allboards is an All Boards route
boardsList.js filters boards by membership only on the All Boards routes. A
route missing from that list falls through to the public-boards branch, so
the page would show public boards instead of the user's own. The list is home,
allboards, allboards-templates, allboards-remaining.
Old URLs
| Old | Now |
|---|---|
/templates |
/allboards/templates |
/remaining |
/allboards/remaining |
They redirect with the redirect their trigger is handed, never with
FlowRouter.go() — a go() from inside triggersEnter runs while that route is
still entering and is swallowed, so nothing renders and the browser keeps showing
whatever page it was on.
{{pathFor 'allboards-templates'}} in userHeader.jade still resolves, through
that redirect.
Related files
| File Path | File Type | Description |
|---|---|---|
models/lib/allBoardsUrls.js |
.js module, pure |
The sections, the workspace slug path both ways, and the path builder. slugify is passed IN, so the module has no dependencies and can be tested with a stub. |
config/router.js |
.js routes |
The /allboards/:section?/:path* route and the old-URL redirects. |
client/components/boards/boardsList.js |
.js Blaze template logic |
Resolves the workspace once the tree loads, and puts a clicked entry in the URL. |
tests/allBoardsUrls.test.cjs |
.cjs Node test |
Both directions of the slug path, the fallbacks, the wildcard splitting, and the wiring — including that getSlug is the one board URLs use. |
Related
- All Boards — the page these URLs open
- The Admin Panel's URLs — the same idea, for the Admin Panel
Commits
- All Boards: Home is a section with its own URL
- Open Starred, or Remaining when nothing is starred
- The Archive is a section of All Boards, at /allboards/archive
- Pin that a workspace nests as deep as its tree does
- The header bar names the list, and the workspace inside it
- A URL for every left-menu entry, workspaces included