Hypertext Rails

Documentation

Getting Started

Communication Center

Procore / Project Groups

Analytics Database

Other Features

Compiled Template — Gap Analysis: New Designs vs Current App

PR: tonic-agency/peptalk#123
Reference: Current app behavior is documented in COMPILEDTEMPLATELAYOUT_SPEC.md.

This document lists the differences between the new compiled template designs (single and multi-project) and what the application currently generates. Items below are gaps to address if the app is to match the new designs.


1. New Single Template (Design Reference)

The new single-template design includes:

  • Header: Project name + “The Story So Far: <start date> – <end date>” (one user-facing report date range).
  • Total Check-Ins for that report period.
  • Average Team Morale gauge with value and optional delta.
  • Weekly Morale chart with X-axis spanning the report date range (e.g. Sept 21, 2025 – Feb 15, 2026), baseline line, and colour-coded bars.
  • Risk: Highest Risk Day, Highest Risk Hour.
  • Insights row:
    • Top Wins Areas (labelled “Top Wins” in design) with percentages.
    • Top Opportunity Areas (labelled “Top Opportunity Areas”) with percentages.
    • Spotcheck Results with per-spotcheck date ranges (e.g. “Jan 21 – Feb 4, 2025”, “Nov 14 – Dec 5, 2025”), question/theme, top response, and “X% of N responses”.

All of the above (chart, spotchecks, top wins, top opportunities) are intended to be driven by one user-provided report date range.


2. New Multi-Project Template (Design Reference)

The new multi-project design includes:

  • One card per project, each with:
    • Project name and a project-specific date range (e.g. “Mar 11 – August 31, 2025” for Project 1, “Mar 6 – August 31, 2025” for Project 2).
    • Team Morale gauge with value and baseline comparison (“▼ Below baseline of 98”, “▲ Above baseline of 55”, or “Baseline: In Establishment Phase”).
    • Total Check-Ins for that project in its date range.
    • Top Opportunity Area (single top item).
    • Spotcheck details with per-spotcheck date ranges and response metrics.
  • When a project has no data (e.g. new project): the morale area still shows a value and “Baseline: In Establishment Phase”, and the spotcheck area shows “In Establishment Phase” inside the box instead of leaving the box blank or missing.

So: per-project date ranges and “In Establishment Phase” placeholders are part of the new multi design.


3. Current App Behaviour (Summary)

  • Single template: Uses the grid in _compiled_template.html.erb (Row 1: header, Row 2: morale + charts + risk, Row 3: insights, Row 4: regular lists). See COMPILEDTEMPLATELAYOUT_SPEC.md.
  • Date ranges:
    • Charts: Driven by DashboardSetting.baselinecalculationperiod (e.g. 1 = last month) and fixed logic (e.g. weekly = 3 months, monthly = 6 months). No single user-provided “report date range” that drives the whole report.
    • Spotcheck Results, Top Wins / Top Opportunity (What Could Be Better / What Is Going Well), Action Tracker: Date ranges are per component, via token params (e.g. from_date, to_date, start_date, end_date). There is no global report date range that all components share.
  • Header: Shows project name, report type, current month for check-in volume, and Date.current for the “current month” label — not a user-configurable “The Story So Far” range.
  • Multi-project: Uses _compiled_template_multi_project.html.erb with a simplified 2-column layout. One global date-range configuration is applied to all projects; there are no project-specific date ranges per card.
  • Empty / no data: When there is no data for a section (e.g. no spotchecks, no list items), the app can omit the section or show an empty area; it does not show an “In Establishment Phase” label or keep the box with that placeholder text.

4. Differences: New vs Current (Single Template)

Area New design Current app Gap
Report date range One user-provided range (“The Story So Far: <start> – <end>”) that drives chart, spotchecks, top wins, top opportunities. No single report range. Chart uses DashboardSetting.baseline_calculation_period. Lists/spotchecks use per-component date params in the template token. Need a report-level date range that drives all relevant components (or explicit design to keep per-component ranges).
Header date / period Header shows the report range (e.g. “Sept 21 2025 – Feb 18 2026”). Header shows current month (e.g. “March 2026”) and volume for current/previous month. Header does not show a user-defined “story so far” range.
Charts Chart X-axis and data span the report date range. Chart uses baselinecalculationperiod (e.g. 1 month) and fixed windows (e.g. weekly = 3 months, monthly = 6 months). Charts are not driven by a user-provided report date range.
Spotcheck Results Each spotcheck shows its date range (e.g. “Jan 21 – Feb 4, 2025”) and is aligned to the report range. Date range comes from token params (start_date / end_date). No shared report range. Same data exists per component; missing is a single report range that drives or labels the report.
Top Wins / Top Opportunity Driven by the report date range. Driven by token params (from_date / to_date) per LIST. Same as above: no shared report range; dates are per component.
Naming “Top Wins Areas” and “Top Opportunity Areas”. “What Is Going Well” and “What Could Be Better” (or custom list labels). Label/terminology difference only if product wants to align names.

5. Differences: New vs Current (Multi-Project Template)

Area New design Current app Gap
Date range per project Each project card has its own date range (e.g. Project 1: “Mar 11 – Aug 31, 2025”, Project 2: “Mar 6 – Aug 31, 2025”). One global date configuration applied to all projects. App does not support project-specific date range parameters.
“In Establishment Phase” When there’s no baseline or no spotcheck data, the card still shows the box with the text “In Establishment Phase” (e.g. under Team Morale and in the spotcheck section). When there’s no data, the section is empty or the box is not rendered (no placeholder text). App does not show “In Establishment Phase” when there is no data; box can be absent or blank.
Layout / content per card Per card: project name, project date range, Team Morale + baseline line, Total Check-Ins, Top Opportunity Area, Spotcheck details with per-spotcheck dates. Multi layout is a simplified 2-column grid; content and structure may not match the new card layout and may not show per-project ranges or baseline phrasing. Multi layout and content need to be aligned with the new card design and per-project ranges.

6. Summary Checklist (Gaps to Implement)

Single template

  • [ ] Introduce a report-level (user-provided) date range that can drive (or at least label) chart, spotchecks, top wins, top opportunities.
  • [ ] Charts: Use this report range (or a chosen policy) for the chart’s X-axis and data instead of only baseline_calculation_period and fixed windows.
  • [ ] Header: Option to show the report range in the header (e.g. “The Story So Far: <start> – <end>”) instead of/in addition to current month.
  • Align labels with design (e.g. “Top Wins Areas”, “Top Opportunity Areas”) if required.

Multi-project template

  • [ ] Support per-project date range parameters so each project card can show its own timeline.
  • [ ] When a project has no baseline or no spotcheck data, show the section box with placeholder text “In Establishment Phase” instead of leaving it blank or omitting the box.
  • [ ] Align multi-project layout and content with the new card design (project range, baseline comparison, total check-ins, top opportunity, spotcheck details with dates).

7. What Is Already Aligned (No Gap)

  • Single template: Row structure (header, morale, charts, risk, insights) and component types (gauges, charts, lists, spotchecks, action tracker) exist. Spotcheck gauge is correctly excluded from the morale row (dev fix: value_var == 'spotcheck' not added to gauges). Date ranges for lists and spotchecks are passed via token params and respected by the resolver.
  • Data sources: Tables and attributes used for morale, spotchecks, lists, and action tracker are as described in COMPILEDTEMPLATELAYOUT_SPEC.md; the gap is how date ranges are chosen (report-level vs per-component, per-project vs global), not the underlying queries.
  • Multi-project: Multi-project mode exists (multi_project_mode, _compiled_template_multi_project.html.erb); the gap is per-project dates and “In Establishment Phase” behaviour, plus layout/copy alignment with the new design.

Last updated to reflect PR #123 task notes and new single/multi template design references.