Skip to content

[bug] fix shift timeline #135

Open
1 of 1 issue completed
Open
Feature
1 of 1 issue completed
@ZhixiaLin

Description

@ZhixiaLin

This is driver's today's view, eg: /drivers/71/today?date=2025-07-01
Right now if we have multiple shifts on the same day for a certain driver, only the last shifts notes will appear.

Image Image Image Image

The issue does not affect one shift with multiple rides or cases where multiple drivers each have a single shift. This is because the Timeline & Notes is designed to display the notes field from a single shift object, rather than aggregating them from all relevant shifts.

<% shift_today = Shift.find_by(driver_id: @driver.id, shift_date: @current_date) %>
  <% if shift_today %>
    <div class="shift-notes">
      <h3>Timeline & Notes</h3>
      <p><%= shift_today.notes.presence || "No info available for this shift." %></p>
    </div>
  <% else %>
    <p>No shift found for this driver on <%= @current_date.strftime("%m/%d/%Y") %>.</p>
  <% end %>
  • Line break display support
  • Display notes for each shift individually (easy mode); Ensure that notes edited for a driver on a given day are shared across all of that driver's shifts on that date(hard mode)

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions