Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/components/UncategorizedNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ div
| #[b High uncategorized time]
br
| You have a total of {{ uncategorizedDuration[0] | friendlyduration }} uncategorized time,
| that's {{ Math.round(100 * uncategorizedDuration[0] / uncategorizedDuration[1]) }}% of all time today.
| that's {{ Math.round(100 * uncategorizedDuration[0] / uncategorizedDuration[1]) }}% of all time {{ periodText }}.
| You can address this by using the #[router-link(:to="{ path: '/settings/category-builder' }") Category Builder].
</template>

Expand All @@ -16,6 +16,12 @@ import { useActivityStore } from '~/stores/activity';

export default {
name: 'aw-uncategorized-notification',
props: {
periodLength: {
type: String,
default: 'day',
},
},
computed: {
...mapState(useActivityStore, ['uncategorizedDuration']),
ratio() {
Expand All @@ -27,6 +33,17 @@ export default {
total() {
return this.uncategorizedDuration ? this.uncategorizedDuration[1] : 0;
},
periodText() {
const periodMap: Record<string, string> = {
day: 'today',
week: 'this week',
month: 'this month',
year: 'this year',
last7d: 'the last 7 days',
last30d: 'the last 30 days',
};
return periodMap[this.periodLength] || 'today';
},
isVisible() {
// TODO: make configurable?
// if total duration is less than 1 hour, don't show it
Expand Down
2 changes: 1 addition & 1 deletion src/views/activity/Activity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ div

aw-periodusage.mt-2(:periodusage_arr="periodusage", @update="setDate")

aw-uncategorized-notification()
aw-uncategorized-notification(:periodLength="periodLength")

ul.row.nav.nav-tabs.mt-4
li.nav-item(v-for="view in views")
Expand Down