Skip to content

fix(query): use native date inputs in query options - #953

Merged
ErikBjare merged 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/native-date-query-options
Aug 31, 2026
Merged

fix(query): use native date inputs in query options#953
ErikBjare merged 3 commits into
ActivityWatch:masterfrom
TimeToBuildBob:bob/native-date-query-options

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What changed

Replace the Start and Stop BootstrapVue date pickers in QueryOptions.vue with native input type="date" controls. Search, Report, Graph, and Category Builder share this component, so they now support keyboard date entry and platform-native date selection consistently with Query Explorer.

The affected callers now keep date values in YYYY-MM-DD form both initially and when extending a range, preserving query semantics while satisfying native input requirements.

Fixes #944

Verification

  • vue-cli-service lint on all changed Vue/test files
  • tsc --noEmit --pretty false
  • jest --selectProjects jsdom --runInBand test/unit/QueryOptions.test.js (3 tests)
  • Playwright smoke test on Search, Report, and Graph: two visible native date controls per view; keyboard-filled 2026-08-15 / 2026-08-16 values persisted

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.55%. Comparing base (13a9428) to head (f7b0a8e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #953   +/-   ##
=======================================
  Coverage   49.55%   49.55%           
=======================================
  Files          45       45           
  Lines        2779     2779           
  Branches      596      629   +33     
=======================================
  Hits         1377     1377           
  Misses       1381     1381           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the shared BootstrapVue date pickers with native date controls while preserving string-compatible query behavior.

  • Initializes Search and Category Builder ranges as YYYY-MM-DD strings.
  • Keeps all Search, Report, and Graph range-extension paths compatible with native date inputs.
  • Adds unit coverage for native date rendering, initialization, and range extension.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/components/QueryOptions.vue Replaces both shared date pickers with native date inputs; current callers provide compatible values.
src/views/Search.vue Formats initial and extended Search dates as YYYY-MM-DD strings.
src/views/Report.vue Formats the extended Report start date before rerunning generation.
src/views/Graph.vue Formats the extended Graph start date before regenerating results.
src/views/settings/CategoryBuilder.vue Initializes Category Builder dates in the format required by native date inputs.
test/unit/QueryOptions.test.js Covers native input rendering and the corrected initialization and extension formats.

Reviews (3): Last reviewed commit: "fix(query): preserve native date value f..." | Re-trigger Greptile

Comment on lines +8 to +10
input.form-control(type="date" v-model="queryOptionsData.start")
b-form-group(label="Stop" label-cols=2)
b-form-datepicker(v-model="queryOptionsData.stop")
input.form-control(type="date" v-model="queryOptionsData.stop")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Moment values blank date inputs

When Search or Category Builder opens, their Moment-valued defaults are copied directly into these native date inputs instead of being normalized to YYYY-MM-DD, causing the Start and Stop controls to render blank rather than showing the active query range.

Knowledge Base Used:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b31bca3. mounted() now formats start/stop to YYYY-MM-DD before the native date inputs bind, so Moment-valued defaults from Search and Category Builder show the active range instead of blank controls.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

Comment thread src/components/QueryOptions.vue Outdated
Comment on lines +63 to +64
start: moment(this.queryOptions?.start || this.queryOptionsData.start).format('YYYY-MM-DD'),
stop: moment(this.queryOptions?.stop || this.queryOptionsData.stop).format('YYYY-MM-DD'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Range extension blanks start date

When a user extends the Search, Report, or Graph range by one week, extendByWeek assigns a Moment to queryOptions.start after the mount-only normalization has run. That Moment reaches the native date input without being converted to YYYY-MM-DD, causing the Start control to render blank even though the query uses the extended range.

Knowledge Base Used: Queries and reporting

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click.

This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted.

@ErikBjare
ErikBjare merged commit 2e757c5 into ActivityWatch:master Aug 31, 2026
9 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.

Make the date picking more consistent across all pages

2 participants