Skip to content

FEATURE: online workflow burndown/up chart#18

Merged
merefield merged 8 commits intomainfrom
charts
Feb 23, 2026
Merged

FEATURE: online workflow burndown/up chart#18
merefield merged 8 commits intomainfrom
charts

Conversation

@merefield
Copy link
Copy Markdown
Owner

@merefield merefield commented Feb 23, 2026

Summary

This PR delivers a workflow discovery UX and reporting expansion with three integrated workflow views (List, Kanban, Chart), stronger runtime hardening, and broader automated coverage.

It adds charting for workflow step counts over time, improves list/kanban SPA behavior, aligns job loading/naming with Zeitwerk autoloading conventions, and tightens chart mode visibility so only authorized users see
Chart in the workflow view selector.

Functional Improvements

  1. Discovery now supports a unified view selector:
  • List (topic table)
  • Kanban (actionable board)
  • Chart (burn down trend)
  • Selector appears contextually based on compatibility/scope.
  1. Workflow charts:
  • New chart endpoint and UI integration (/workflow/charts and chart mode in /workflow).
  • Period selector from 1 to 12 weeks.
  • Full-week windows (Sunday to Saturday).
  • Per-step series with step/category color mapping.
  • Payload now returns selected workflow metadata only (no full workflow catalog).
  1. Chart permissions and UX:
  • New setting: workflow_charts_allowed_groups.
  • Access: admins + configured groups.
  • Chart option is hidden from users without chart permission.
  • Chart permissioning is intentionally separate from topic-level category permissioning.
  1. Workflow quick-filter/SPA behavior:
  • Query-param driven transitions without full page reload.
  • Persisted quick filters in local storage.
  • Better view-state synchronization across route transitions.
  • Ongoing list/kanban improvements remain intact (toggle behavior, stale-state refresh handling, overdue/list indicators).
  1. Runtime/job reliability:
  • Workflow jobs now follow Zeitwerk autoloading conventions.
  • Scheduled jobs are visible/reliable without plugin-level manual requires.
  • Transition enqueue path updated to new namespaced notifier job.
  • WorkflowStat associations corrected to belongs_to for proper relation semantics.

Technical Changes

  • Added: app/controllers/discourse_workflow/workflow_charts_controller.rb
  • Added: lib/discourse_workflow/charts_permissions.rb
  • Added frontend route wiring for charts:
    • assets/javascripts/discourse/discourse-workflow-route-map.js
    • assets/javascripts/discourse/routes/discovery/workflow-charts.js
    • assets/javascripts/discourse/controllers/discovery/workflow-charts.js
  • Added chart connector:
    • assets/javascripts/discourse/connectors/discovery-list-container-top/z-workflow-burndown-chart.gjs
  • Extended quick filters connector for multi-view behavior and chart gating:
    • assets/javascripts/discourse/connectors/discovery-list-container-top/workflow-quick-filters.gjs
  • Updated plugin/list serialization and permission flags:
    • plugin.rb
    • lib/discourse_workflow/list_controller_extension.rb
  • Added setting + locale updates:
    • config/settings.yml
    • config/locales/client.en.yml
    • config/locales/server.en.yml
  • Updated styles for chart and view controls:
    • assets/stylesheets/common/workflow_common.scss
  • Updated routes:
    • config/routes.rb
  • Zeitwerk alignment for jobs:
    • moved jobs to namespaced paths:
      • app/jobs/scheduled/discourse_workflow/*
      • app/jobs/regular/discourse_workflow/*
    • renamed classes to Jobs::DiscourseWorkflow::* to match file paths
    • removed legacy plugin-level require workaround
    • added scheduled-job eager-load wiring in lib/discourse_workflow/engine.rb

New / Updated Tests

  • Request specs:
    • spec/requests/workflow_charts_controller_spec.rb
      • permissions, routing, week windows, selected-workflow payload contract
  • System specs:
    • spec/system/workflow_charts_spec.rb
      • chart rendering, view switching, period selection
    • spec/system/workflow_quick_filters_spec.rb
      • chart visibility gating in view selector
  • Page objects:
    • spec/system/page_objects/pages/workflow_discovery.rb (chart interactions/assertions)
  • Job specs:
    • spec/jobs/scheduled/discourse_workflow/daily_stats_spec.rb
    • spec/jobs/scheduled/discourse_workflow/ai_transitions_spec.rb
    • spec/jobs/scheduled/discourse_workflow/data_explorer_queries_completeness_spec.rb
    • spec/jobs/regular/discourse_workflow/topic_arrival_notifier_spec.rb
  • Fabricator:
    • spec/fabricators/workflow_stat_fabricator.rb

Validation

  • Full plugin suite passes:
    • bin/rspec plugins/discourse-workflow/spec
    • Result: 76 examples, 0 failures
  • Targeted request/system/job specs and formatting/rubocop checks pass for touched files.

Notes

  • Chart access model is intentionally broader than topic-level visibility and is controlled by workflow_charts_allowed_groups (plus admin access).
  • If stricter chart visibility is desired later, it can be introduced as an optional mode without affecting current behavior.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Chart” workflow discovery view (burn down/up trend) with backend data endpoint, permission gating, and supporting UX/state changes across the workflow discovery experience, plus a refactor of workflow jobs into Zeitwerk-friendly namespacing.

Changes:

  • Introduces workflow charts: /workflow/charts discovery route + /discourse-workflow/charts.json data endpoint, including weeks horizon (1–12) and per-step series.
  • Updates workflow discovery quick filters to a multi-view selector (List/Kanban/Chart) with chart visibility gated by a new setting.
  • Refactors workflow jobs into Jobs::DiscourseWorkflow::* namespacing and adds specs/fabricators to expand automated coverage.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
spec/system/workflow_quick_filters_spec.rb Adds system coverage for hiding “Chart” when not permitted; updates view assertions to use selector value.
spec/system/workflow_charts_spec.rb New system coverage for chart rendering, view switching, and weeks selector behavior.
spec/system/page_objects/pages/workflow_discovery.rb Extends page object with chart/view selector helpers used by system specs.
spec/requests/workflow_charts_controller_spec.rb New request specs for charts API permissions, routing, week windows, and payload contract.
spec/jobs/scheduled/discourse_workflow/data_explorer_queries_completeness_spec.rb New unit coverage for Data Explorer query seeding behavior.
spec/jobs/scheduled/discourse_workflow/daily_stats_spec.rb New coverage for daily stats scheduled job behavior.
spec/jobs/scheduled/discourse_workflow/ai_transitions_spec.rb New coverage ensuring AI transitions scheduled job delegates properly.
spec/jobs/regular/discourse_workflow/topic_arrival_notifier_spec.rb New coverage for topic arrival notifier job behavior.
spec/fabricators/workflow_stat_fabricator.rb Adds fabricator for workflow stats used in tests.
plugin.rb Adds /workflow/charts route, chart permission flags/metadata in topic_list serialization.
lib/discourse_workflow/transition.rb Updates transition path to enqueue the new namespaced notifier job.
lib/discourse_workflow/list_controller_extension.rb Adds workflow_charts list action with permission gating.
lib/discourse_workflow/engine.rb Eager-loads scheduled jobs dir to satisfy Zeitwerk/runtime job loading.
lib/discourse_workflow/charts_permissions.rb Centralizes chart permission check (admins + allowed groups).
config/settings.yml Adds workflow_charts_allowed_groups setting.
config/routes.rb Adds engine route for charts JSON endpoint; removes old application route snippet.
config/locales/server.en.yml Adds setting description and access-denied message for charts.
config/locales/client.en.yml Adds client strings for chart view and chart UI labels.
assets/stylesheets/common/workflow_common.scss Adds styling for view selector and chart layout; hides topic list in chart mode.
assets/javascripts/discourse/routes/discovery/workflow-charts.js Adds Ember discovery route for /workflow/charts.
assets/javascripts/discourse/initializers/init-workflow.gjs Registers chart-related query params and marks workflow list routes for column transforms.
assets/javascripts/discourse/discourse-workflow-route-map.js Adds route-map entry for discovery.workflowCharts.
assets/javascripts/discourse/controllers/discovery/workflow-charts.js Adds controller inheriting from discovery list controller for charts route.
assets/javascripts/discourse/connectors/discovery-list-container-top/z-workflow-burndown-chart.gjs New chart connector: fetches chart series + renders Chart.js line chart in discovery outlet.
assets/javascripts/discourse/connectors/discovery-list-container-top/workflow-quick-filters.gjs Converts kanban toggle to a view selector; adds chart weeks selector and chart gating.
app/models/discourse_workflow/workflow_stat.rb Fixes associations to belongs_to for correct relation semantics.
app/jobs/scheduled/workflow_daily_stats.rb Deletes old unnamespaced scheduled job file.
app/jobs/scheduled/workflow_ai_transitions.rb Deletes old unnamespaced scheduled job file.
app/jobs/scheduled/discourse_workflow/data_explorer_queries_completeness.rb Moves scheduled job to Jobs::DiscourseWorkflow namespace; improves warning message.
app/jobs/scheduled/discourse_workflow/daily_stats.rb Adds new namespaced daily stats scheduled job.
app/jobs/scheduled/discourse_workflow/ai_transitions.rb Adds new namespaced AI transitions scheduled job.
app/jobs/regular/workflow_topic_arrival_notifier.rb Deletes old unnamespaced regular job file.
app/jobs/regular/discourse_workflow/topic_arrival_notifier.rb Adds new namespaced topic arrival notifier job.
app/controllers/discourse_workflow/workflow_charts_controller.rb Adds charts JSON endpoint with authorization, week normalization, and per-step series building.
README.md Documents chart view behavior, access model, and job list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@merefield merefield merged commit 8dd0e7f into main Feb 23, 2026
6 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