Repository navigation
UI: a control taxonomy (filter vs nav vs settings vs action) + a persistent reporting-period bar #1378
naoswilbrink
started this conversation in
Ideas
Replies: 1 comment
|
Opened #1379 for Phase 1 (remember the period across reports, no UI change) — wired for P&L and Balance Sheet as a sample, CI pending. Happy to hold it until the approach here is discussed. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Spun out of #1371. Two related things: a small control taxonomy so a control's look and behaviour is predictable from what it does, and a concrete first application — a persistent reporting-period bar for Financial reports.
The trigger: switching between financial reports resets the date range every time, because the range lives inside the "Customize report" Save/Cancel drawer. Changing what period you're looking at shouldn't feel like editing a configuration you have to save — and you can't review a set of reports for one period without re-entering dates in each.
Part 1 — Control taxonomy
A control's look and interaction should be predictable from what it does. Right now Bigcapital mixes them — the clearest case being the reports date range (a filter) trapped inside a Save/Cancel drawer (settings).
The four categories
Decision guide
1. Selection / filter
Narrow, scope, or switch what the current view shows — date range, status, branch, account, search, group-by.
Select/MultiSelect/HTMLSelect,Popover+Menufor grouped,Tagfor chips,InputGroupfor search,ButtonGroupfor segmented, in a<ControlGroup>toolbar.2. Navigation
Go somewhere — a report, a record, a settings page, a section.
<Link>,Tabs,Breadcrumbs,MenuItemwithhref,AnchorButtonminimalonly.3. Configuration / settings
Change how something behaves or presents — report display columns, comparison periods, number format, preferences, branding.
[Cancel] [Save].Drawer(side), routed page (global),Dialog(small). Footer = the standard secondary/primary pair.4. Action / command
Perform an operation with a side effect — create, send, publish, post, delete, void, reconcile.
intent="primary", one per view, reachable without scrolling (sticky footer on forms/dialogs).minimal; Cancel, Back, Save draft.⋮overflow menu (always, on mobile).intent="danger", separated, behind anAlertconfirm, never adjacent to primary.Anti-patterns to sweep
Part 2 — Applied: a persistent reporting-period bar
How it works today
useAppQueryString, ~17 reports).getDefault<Report>Query()(~20 of them), each hardcodingfromDate/toDate.?fromDate=…&toDate=….FinancialStatementDateRange.tsxalready renders the preset<HTMLSelect>+ two date inputs — it just lives inside the drawer form.dateRangeOptionstoday is only current-period buckets —today,this_week,this_month,this_quarter,this_year,custom. No year-to-date, no prior year, no specific quarter — you drop to Custom and type dates.How other tools do it
The consistent idea: the date range is a first-class, always-visible control, held in one place and remembered; "Customize" is for the rest.
Proposed design
A persistent period bar
<FinancialReportPeriodBar>rendered by the reports layout, above every report (not in a drawer):Redesigned preset menu (a
Menuwith submenus, not a flat select)YYYYuse the org's fiscal-year start (organization.fiscalYear), quarters counted from there.parseDateRangeQuery's keyword table with a resolver taking{ preset, year?, quarter?, fiscalYearStartMonth }→{ fromDate, toDate }, keeping a string-keyword form for URL round-tripping (?dateRange=fy2025-q3).One shared, remembered period
A
useReportingPeriod()hook over a single store:localStoragekeybigcapital:financial-reports:period={ dateRange, fromDate, toDate }.SETTINGSstore.Rules:
fromDate/toDate/dateRangefrom the store (falling back to the report's hardcoded default only when the store is empty)."Customize report" drawer
FinancialStatementDateRange) — they move to the bar.Phasing (each = one PR)
useReportingPeriod()(localStorage) + awithRememberedPeriod(defaultQuery)helper routed through the ~20getDefault<Report>Query()fns; submitting a filter also writes the store. Result: click through reports and the range carries over. Low risk, no layout change — directly answers the complaint.<FinancialReportPeriodBar>to the reports layout; wire touseReportingPeriod()+ the current report's query; the redesigned preset menu; remove the date rows from the drawer; rename the button.Scope / risk
I can open the P1 PR now (it's small and self-contained); posting this first for feedback on the taxonomy and the bar design before P2.
All reactions