Three things, as asked. NO DUPLICATE BOARD NAME. The second bar drew the board's title in an `h1` of its own, under the same name in the bar above it. The first bar has said it since the first step of this work; the h1 is gone. THE PENCIL IS BESIDE THE NAME. Renaming a board belongs next to the board's name, not in a bar of its own, so `boardEditTitleButton` renders immediately right of the title in the first bar. Board admins only, as before. EVERYTHING ELSE IS AN ICON, LEFT OF THE BELL. Visibility, watch, star, sort, the board's rule buttons, filter, search, dependencies and Multi-Selection, each named by a tooltip and none carrying a visible label. The bar is one row shared with the logo, the starred boards, the view menu, the bell and the user menu; ten labelled buttons do not fit at any width. The desktop/mobile duplication went with it. The old bar wrote the whole set out TWICE - `unless isMiniScreen` and `if isMiniScreen` - because a row of labelled buttons does not fit on a phone. Icons do, so one copy serves both, and the two switches that had to be kept in step are gone rather than kept in step. headerBarControls.jade is deleted. It held one Search button and one Multi-Selection button, written for this bar and All Boards'; both bars are gone now, so a template shared by nobody was indirection rather than sharing. Every route reference goes with the bar: config/router.js names no headerBar at all any more. Six guards followed, and four of them existed only to measure this bar: the title-plus-buttons row that a long board title split across two lines, the wrapper that fixed it, the phone layout, and the hamburger that shared the first row with the title. All of that was one problem, and the problem is gone with the row. Each says so where it used to measure it, rather than being deleted. Thanks to xet7 !
4.2 KiB
Design: Search
Search is a header-bar button that opens the right sidebar on its search view. That is true on a board and on All Boards, and it is the same button in both — one template, included twice.
The control
| Template | headerSearchButton in client/components/boards/boardHeader.jade |
| Class | a.board-header-btn.js-open-search-view |
| Icon | fa-search |
| Label | {{_ 'search'}} |
It carries no handler of its own. A Blaze event map catches events from the
templates rendered inside it, so Template.boardHeaderBar.events sees the click
on the board's copy and Template.boardListHeaderBar.events sees the click on
the All Boards copy. That is what lets one piece of markup mean two things:
| Page | The click | What is searched |
|---|---|---|
| Board (Swimlanes, Lists, …) | Sidebar.setView('search') |
the cards and lists of that board |
| All Boards | openAllBoardsSidebar(SIDEBAR_SEARCH) |
your boards |
Why a button and not a field
All Boards carried the search input in the header bar for a while, on the reasoning that a filter belongs in the bar it filters. The reasoning was fine; the result was that the two pages had different controls with the same name in the same place, and only one of them behaved like the rest of WeKan. The button is the shared answer.
The field did not disappear — it is what the sidebar's search view is. What changed is where it lives and how you get to it.
The All Boards search view
allBoardsSearchSidebar, in client/components/boards/allBoardsSidebar.jade.
It is an autofocused text input and a Clear row, and it writes into
allBoardsSearchVar — the page's own search term, not a copy — so the board
list behind the sidebar narrows as you type, exactly as the header-bar field
did. The Lists view and the Table view both read that term, so both filter.
Escape in the field clears it when it has text, and only falls through to the
sidebar's own Escape when it is already empty: Escape on a search box means
"undo the search" before it means "close the panel".
The field is not styled by this page at all. .sidebar .sidebar-content input[type="text"] in the board sidebar's stylesheet gives every sidebar input
its full-width look, and that stylesheet is loaded everywhere.
A control that moves between templates takes its stylesheet with it or stops being styled at all, silently.
.boards-path-header .board-searchkept matching nothing for two commits while the box rendered at the browser's default input size.
The panel it opens in is the All Boards sidebar, and where it sits and how it is themed is All Boards: pinned below the header to the window bottom on a desktop, with the board icons moved left rather than covered; full width on a phone; and painted with a theme at both sizes, because a sidebar button is white text that needs a themed background under it.
The board search view
searchSidebar, in client/components/sidebar/sidebarSearches.js — unchanged.
It searches currentBoard.searchCards / searchLists and renders minicards and
minilists.
Related files
| File Path | File Type | Description |
|---|---|---|
client/components/boards/allBoardsSidebar.jade |
.jade template |
allBoardsSearchSidebar, the All Boards search view. |
client/components/boards/allBoardsSidebar.js |
.js Blaze template logic |
Its handlers; writes the page's search term. |
client/lib/allBoardsView.js |
.js module |
allBoardsSearchVar, the term the page filters by. |
client/components/sidebar/sidebarSearches.js |
.js Blaze template logic |
The board's search view. |
client/components/boards/boardHeader.js |
.js Blaze template logic |
The board's click handler. |
client/components/boards/boardsList.js |
.js Blaze template logic |
The All Boards click handler. |
tests/allBoardsPage.test.cjs |
.cjs Node test |
That the bar has the button and not a field, and that the sidebar view writes the page's term. |
tests/templateRegistration.test.cjs |
.cjs Node test |
That the shared template is imported and that both bars include it. |
Related
- Multi-Selection — the other shared control
- All Boards