Skip to content

Commit

Permalink
intermediate results
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed Oct 10, 2024
1 parent 9ed7fc4 commit 63a10f8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,26 @@
}
}

.amendment-nr {
.amendment-nr-n-icon {
display: block;
//display: flex;
//align-items: center;
//justify-content: flex-start;
//border: 1px solid black;
position: relative;
left: -40px;
bottom:-30px
bottom: 12px;
height: 0;
margin-top: 45px;

.amendment-nr {
position: relative;
bottom: 3px;
font-style: italic;
background-color: rgb(224, 224, 224);
}
}

.os-linebreak {
display: none !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ export class MotionDiffService {
firstLine: change.getLineFrom()
});
let diff = this.diff(oldText, change.getChangeNewText());
//console.log(diff);

// If an insertion makes the line longer than the line length limit, we need two line breaking runs:
// - First, for the official line numbers, ignoring insertions (that's been done some lines before)
Expand All @@ -2022,6 +2023,7 @@ export class MotionDiffService {
DomHelpers.addCSSClassToFirstTag(origBeginning, `merge-before`) + diff.substring(origBeginning.length);
}

//console.log(diff);
return diff;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export class MotionFormatService {

private getDiffView = (targetMotion: MotionFormattingRepresentation, args: DifferedViewArguments): string => {
const { changes, lineLength, highlightedLine, firstLine }: DifferedViewArguments = args;
const text = [];
const text: string[] = [];
const changesToShow = changes.filter(change => change.showInDiffView());
const motionText = this.lineNumberingService.insertLineNumbers({
html: targetMotion.text,
Expand All @@ -239,26 +239,29 @@ export class MotionFormatService {
)
);
}
text.push(`<div class="amendment-nr">`);
if (this.hasCollissions(changesToShow[0], changesToShow)) {
text[text.length - 1] = text[text.length - 1].replace(`os-line-number `, ``);
text.push(`<span class="amendment-nr-n-icon">`);
if (this.hasCollissions(changesToShow[i], changesToShow)) {
text.push(`<mat-icon class="margin-right-10">warning</mat-icon>`);
}
const current_text = changesToShow[i];
if (`amend_nr` in current_text) {
text.push(`<span>`, current_text.amend_nr);
if (current_text.amend_nr === `` && !this.hasCollissions(changesToShow[0], changesToShow)) {
if (typeof current_text.amend_nr === `string`) {
text.push(`<span class="amendment-nr">`, current_text.amend_nr);
}
if (current_text.amend_nr === ``) {
text.push(`Amendment`);
}
text.push(`</span></div>`);
text.push(`:</span></span>`);
}
text.push(this.diffService.getChangeDiff(motionText, changesToShow[i], lineLength, highlightedLine));
lastLineTo = changesToShow[i].getLineTo();
console.log(`outside if `);
}

text.push(
this.diffService.getTextRemainderAfterLastChange(motionText, changesToShow, lineLength, highlightedLine)
);
//console.log(text, text.join(``));
return text.join(``);
};

Expand Down

0 comments on commit 63a10f8

Please sign in to comment.