Skip to content

Commit

Permalink
chat: smoother full search (fixes #8004) (#8009)
Browse files Browse the repository at this point in the history
Co-authored-by: mutugiii <[email protected]>
Co-authored-by: dogi <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent d62c5aa commit ecda720
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.16.26",
"version": "0.16.27",
"myplanet": {
"latest": "v0.21.55",
"min": "v0.20.55"
Expand Down
2 changes: 1 addition & 1 deletion src/app/chat/chat-sidebar/chat-sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<button mat-icon-button color="primary" (click)="resetFilter()" [disabled]="!titleSearch && !searchType" matTooltip="Clear search" i18n-matTooltip [matTooltipDisabled]="!titleSearch && !searchType">
<mat-icon>delete</mat-icon>
</button><br>
<span style="font-size: small; font-style: italic;" i18n>Full Conversation Search </span>
<mat-checkbox [checked]="fullTextSearch" (change)="toggleSearchType()"></mat-checkbox>
<span style="font-size: small; font-style: italic;" i18n>Full Conversation Search </span>
<button style="text-align: end;" mat-icon-button (mouseenter)="toggleOverlay()" (mouseleave)="toggleOverlay()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
<mat-icon>help_outline</mat-icon>
</button>
Expand Down
4 changes: 4 additions & 0 deletions src/app/chat/chat-sidebar/chat-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ li:hover {
margin-left: 4px;
}

.mat-checkbox {
margin-right: 4px;
}

@media only screen and (max-width: $screen-md) {
.expand-button {
top: 10px;
Expand Down
12 changes: 6 additions & 6 deletions src/app/tasks/tasks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ export class TasksComponent implements OnInit {
}

isTaskDueSoon(task): boolean {
if (!task || task.completed || !task.deadline) return false;
if (!task || task.completed || !task.deadline) { return false; }

const now = new Date();
const deadline = new Date(task.deadline);
const twentyFourHoursFromNow = new Date(now.getTime() + 24 * 60 * 60 * 1000);

const isWithinNextDay = deadline <= twentyFourHoursFromNow && deadline > now;

return isWithinNextDay;
}

isTaskOverdue(task): boolean {
if (task.completed || !task.deadline) return false;
if (task.completed || !task.deadline) { return false; }

const now = new Date();
const deadline = new Date(task.deadline);
return deadline < now;
Expand Down

0 comments on commit ecda720

Please sign in to comment.