0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/app/assets/stylesheets/admin
Alan Guo Xiang Tan 4dc52d48be
UX: Redesign custom date range picker on new admin dashboard (#40355)
This commit replaces the admin dashboard's period selector, a segmented
control of preset chips alongside a separate custom control, with a
single trigger that opens a new `DDateRangePicker` ui-kit primitive.

The trigger shows the active preset's name, or the literal date range
when a custom range is active. On desktop the picker opens as an
anchored popover with a preset rail, a dual-month calendar, and
read-only range inputs. On mobile it renders as a bottom-sheet and the
dashboard controls float at the bottom of the viewport. Sidebar presets
apply immediately, while hand-picked ranges require an explicit Apply.
When the active range spans more than two calendar months, the calendar
shows the start and end months side by side so both endpoints stay
visible.

Technical decisions:

- Discourse's only shipped date picker (Pikaday, via `DDatePicker` /
`DDateInput`) is single-date: it has no range selection, two-month view,
hover preview, or presets. The legacy range flow worked around this with
two separate Pikaday inputs, which is the heavy flow this redesign
replaces.
- Rather than fork Pikaday or stack two inputs, the calendar grid is
hand-built on moment.js, which is already a core dependency, so no new
package is added.
- The component owns the month-grid generation, range-selection state,
hover preview, and keyboard navigation (roving tabindex, arrow / Page /
Home / End keys) directly.
- Trade-off: full control over the range-selection visuals and a leaner
path than patching Pikaday, at the cost of owning the accessibility and
keyboard-interaction code rather than inheriting it from a library.
- The picker is a general-purpose ui-kit primitive that owns its preset
constants (7d / 30d / 3m / 6m / 1y). The admin dashboard is its first
consumer; dedicated report surfaces can reuse it later.
2026-05-28 14:14:30 +08:00
..
admin-dashboard-skeleton.scss UI: Loading skeleton for dashboard (#39989) 2026-05-14 12:42:52 +08:00
admin_base.scss UI: Loading skeleton for dashboard (#39989) 2026-05-14 12:42:52 +08:00
admin_bulk_users_delete_modal.scss
admin_config_area.scss UX: Formkit fixes (#39526) 2026-04-27 16:29:49 +02:00
admin_config_color_palettes.scss FEATURE: Enable new color palette edit page (#34566) 2025-09-01 05:37:34 +03:00
admin_config_components.scss DEV: Use reusable d-table instead of admin-only styles (#33531) 2025-07-10 19:58:04 -06:00
admin_dashboard.scss UX: Redesign custom date range picker on new admin dashboard (#40355) 2026-05-28 14:14:30 +08:00
admin_filter.scss DEV: Replace all @breakpoint with @viewport.* (#32649) 2025-05-12 12:52:45 +01:00
admin_filter_controls.scss FEATURE: Upcoming changes part 1 (#34617) 2025-10-30 10:46:14 +10:00
admin_intro.scss DEV: Replace all @breakpoint with @viewport.* (#32649) 2025-05-12 12:52:45 +01:00
admin_new_category_setup.scss A11Y: switch category card to focus-within (#38836) 2026-03-25 12:25:04 -04:00
admin_report.scss UX: refactor User Visit report and layout for all reports (#37627) 2026-03-06 08:53:17 +08:00
admin_report_chart.scss FEATURE: Who's posting section of the dashboard engagement section (#40225) 2026-05-22 12:46:32 +08:00
admin_report_counters.scss DEV: Introduce postcss minmax transform (#31885) 2025-03-18 19:28:52 +00:00
admin_report_inline_table.scss
admin_report_radar.scss
admin_report_stacked_chart.scss UX: refactor User Visit report and layout for all reports (#37627) 2026-03-06 08:53:17 +08:00
admin_report_stacked_line_chart.scss
admin_report_table.scss UX: minor tweaks to table columns (#37845) 2026-02-16 17:21:02 +01:00
admin_reports.scss UX: refactor User Visit report and layout for all reports (#37627) 2026-03-06 08:53:17 +08:00
admin_section_landing_page.scss UX: Admin dashboard & reports improvements (#37598) 2026-02-24 09:20:38 +08:00
admin_table.scss UX: make admin list item headings clickable (#34772) 2025-09-15 09:08:50 -04:00
admin_user_fields.scss FEATURE: Allow hiding user fields on signup form (#34672) 2025-09-15 10:42:07 +08:00
api.scss FEATURE: improve UX of API key generation (#37789) 2026-02-17 12:03:13 +11:00
backups.scss UX: fix width on hidden-upload-field on the admin backup btn (#34103) 2025-08-06 10:08:29 +02:00
badges.scss FEATURE: Show editable category type settings in tab(s) (#38143) 2026-03-05 11:44:43 +10:00
color-palette-editor.scss FIX: Use valid CSS value for border-radius (#37431) 2026-02-02 16:07:35 +11:00
color_palettes.scss UX: make admin list item headings clickable (#34772) 2025-09-15 09:08:50 -04:00
customize-install-theme.scss UX: Install theme modal tweaks (#39855) 2026-05-08 12:47:41 -04:00
customize.scss FEATURE: Translate theme component translatable fields (#39282) 2026-04-15 21:12:14 +08:00
customize_show_schema.scss FEATURE: porting type object to site settings (#32706) 2025-05-13 14:30:24 -03:00
dashboard.scss UX: refactor User Visit report and layout for all reports (#37627) 2026-03-06 08:53:17 +08:00
discourse_id.scss FEATURE: Discourse ID setting page (#36316) 2025-12-11 16:04:09 +01:00
emails.scss UX: minor improvements to the admin email log layout (#34735) 2025-09-05 10:11:45 -04:00
flags.scss DEV: Move mobile-specific admin styles to admin css bundle (#31529) 2025-02-27 17:20:55 +00:00
json_schema_editor.scss UX: Content border color (#33908) 2025-07-28 16:17:06 -05:00
mini_profiler.scss
penalty.scss DEV: Update linting (#32836) 2025-05-21 12:02:52 +02:00
plugins.scss UX: on plugin index, unlink preinstall, simplify install banner (#33910) 2025-07-29 09:04:07 -04:00
schema_field.scss UX: improve schema setting editor layout (#37058) 2026-01-14 14:50:23 +01:00
schema_setting_editor.scss UX: improve schema setting editor layout (#37058) 2026-01-14 14:50:23 +01:00
search.scss UX: Improve admin search padding (#34280) 2025-08-13 17:00:53 +10:00
settings.scss FEATURE: Allow upcoming changes to control site setting defaults (#38815) 2026-04-08 13:05:44 +10:00
sidebar.scss UX: Fix token issues with admin sidebar (#39946) 2026-05-12 15:50:18 -05:00
site-settings.scss UX: replace old slide-in admin menu behavior with DMenu (#39334) 2026-04-17 09:16:06 -04:00
staff_logs.scss UX: refactor admin action logs buttons (#38292) 2026-03-06 09:11:51 -05:00
upcoming-changes.scss FEATURE: Allow upcoming changes to control site setting defaults (#38815) 2026-04-08 13:05:44 +10:00
users.scss UX: refactor user delete button to dropdown (#39413) 2026-05-04 09:38:39 -04:00