Skip to content

Commit

Permalink
highlighted marking improvements, refactorings (#185)
Browse files Browse the repository at this point in the history
* changes

* prettier

* changes

---------

Co-authored-by: Andi Braimllari <>
  • Loading branch information
AndiBraimllari committed Jul 13, 2023
1 parent 8c347cc commit d308086
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
12 changes: 6 additions & 6 deletions src/app/home/home.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
max-width: 80%;
}

.textMarkinggg {
.text-marking {
display: inline-block;
padding: 3px 6px;
border-radius: 4px;
Expand All @@ -124,13 +124,13 @@
overflow: hidden;
}

.informationCircleee {
.information-circle {
font-size: 20px;
color: #484848;
cursor: pointer;
}

.suggestionsss {
.suggestions {
display: flex;
flex-wrap: wrap;
align-content: stretch;
Expand All @@ -142,22 +142,22 @@
color: black;
}

.suggestionDisplay {
.suggestion-display {
display: flex;
justify-content: center;
align-items: center;
color: #737373;
}

.suggestionsHeader {
.suggestions-header {
display: inline-block;
align-items: flex-start;
margin: 0;
line-height: inherit;
cursor: pointer;
}

.waitingText {
.waiting-text {
display: inline-block;
padding-left: 6px;
padding-right: 6px;
Expand Down
27 changes: 13 additions & 14 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,9 @@ <h5 class="card-title">
>
<div class="card-header secondHeader">
<div class="grid1">
<span
class="textMarkinggg {{ textMarking.type }}"
>{{ getTextOfTextMarking(i) }}</span
>
<span class="text-marking {{ textMarking.type }}">{{
getTextOfTextMarking(i)
}}</span>
</div>
<div>
<button
Expand All @@ -221,14 +220,14 @@ <h5 class="card-title">
</div>
<div *ngIf="textMarking.id">
<i
class="bi bi-info-circle informationCircleee"
class="bi bi-info-circle information-circle"
routerLink="{{ textMarking.id }}"
data-test="marking-information-icon"
></i>
</div>
</div>
<span *ngIf="textMarking.suggestions.length > 0">
<div class="suggestionsss">
<div class="suggestions">
<button
*ngFor="
let suggestion of textMarking.suggestions.slice(
Expand All @@ -247,7 +246,7 @@ <h5 class="card-title">
<b>{{ suggestion.display }}</b>
</button>
<div
class="suggestionDisplay"
class="suggestion-display"
*ngIf="
textMarking.suggestions.length > 4
"
Expand All @@ -263,7 +262,7 @@ <h5 class="card-title">
(click)="
oscillateSuggestion(i, $event)
"
class="suggestionsHeader bi {{
class="bi suggestions-header {{
shouldCollapseSuggestions[i]
? 'bi-arrow-right-square'
: 'bi-arrow-left-square'
Expand All @@ -283,7 +282,7 @@ <h5 class="card-title">
<div class="card-header secondHeader">
<div class="grid1">
<span
class="textMarkinggg {{
class="text-marking {{
highlightedMarking?.type
}}"
>{{
Expand Down Expand Up @@ -313,7 +312,7 @@ <h5 class="card-title">
</div>
<div *ngIf="highlightedMarking?.id">
<i
class="bi bi-info-circle informationCircleee"
class="bi bi-info-circle information-circle"
routerLink="{{
highlightedMarking?.id
}}"
Expand All @@ -328,7 +327,7 @@ <h5 class="card-title">
0
"
>
<div class="suggestionsss">
<div class="suggestions">
<button
*ngFor="
let suggestion of highlightedMarking?.suggestions!.slice(
Expand All @@ -355,7 +354,7 @@ <h5 class="card-title">
<b>{{ suggestion.display }}</b>
</button>
<div
class="suggestionDisplay"
class="suggestion-display"
*ngIf="
(highlightedMarking?.suggestions)!
.length > 4
Expand All @@ -376,7 +375,7 @@ <h5 class="card-title">
$event
)
"
class="bi suggestionsHeader {{
class="bi suggestions-header {{
shouldCollapseSuggestions[
highlightedMarkingIndex
]
Expand Down Expand Up @@ -405,7 +404,7 @@ <h5 class="card-title">
>
<div class="card-header secondHeader">
<div>
<span class="waitingText">duke lexuar shkrimin...</span>
<span class="waiting-text">duke lexuar shkrimin...</span>
</div>
</div>
<ul class="list-group list-group-flush listStyling">
Expand Down
8 changes: 7 additions & 1 deletion src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
this.shouldCollapseSuggestions = new Array<boolean>(
this.processedText.textMarkings.length
).fill(true);

this.blurFocusedRightSideMarking();
});
}

Expand Down Expand Up @@ -391,6 +393,7 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
this.processedText = undefined;
this.updateCharacterAndWordCount();
this.shouldCollapseSuggestions = new Array<boolean>(0);
this.blurFocusedRightSideMarking();
}

/**
Expand Down Expand Up @@ -816,7 +819,10 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
!this.shouldNotMarkEditor(keyboardEvent)
),
debounceTime(this.EVENTUAL_MARKING_TIME),
tap(() => this.markEditor())
tap(() => {
this.blurFocusedRightSideMarking();
this.markEditor();
})
)
.subscribe();
}
Expand Down
Empty file removed src/app/home/rn.ts
Empty file.

0 comments on commit d308086

Please sign in to comment.