Skip to content

Commit bc02597

Browse files
Clean up AI-generated comments per review feedback
Simplify comment wording in TagCell.tsx, PolicyUtils.ts, and TagUtils.ts to be more concise and less verbose. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
1 parent d6aed15 commit bc02597

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/components/TransactionItemRow/DataCells/TagCell.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ function TagCell({canEdit, onSave, shouldUseNarrowLayout, shouldShowTooltip, tra
3333
cancelEditing();
3434
};
3535

36-
// Decode HTML entities so tags stored with encoding (e.g. `uno &amp; dos`) display as `uno & dos`,
37-
// matching the report's group-by-tag dropdown which already decodes the value.
36+
// Decode HTML entities so tags stored with encoding are displayed properly (e.g. `uno &amp; dos` display as `uno & dos`)
3837
const tagForDisplay = getDecodedTagName(getTagForDisplay(transactionItem));
3938

4039
const displayContent = shouldUseNarrowLayout ? (

src/libs/PolicyUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ function getTagNamesFromTagsLists(policyTagLists: PolicyTagLists): string[] {
854854
}
855855

856856
/**
857-
* Cleans up escaping of colons (used to create multi-level tags, e.g. "Parent: Child") in the tag name we receive from the backend,
858-
* and HTML-decodes the result so tags stored with encoded entities (e.g. `R&amp;D`) render as `R&D`.
857+
* Cleans up escaping of colons used to create multi-level tags (e.g. "Parent: Child"),
858+
* and HTML-decodes the result so tags stored with encoded entities display correctly (e.g. `R&amp;D`, renders as `R&D`)
859859
*/
860860
function getCleanedTagName(tag: string) {
861861
return Str.htmlDecode(tag?.replaceAll('\\:', CONST.COLON) ?? '');

src/libs/TagUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function trimTag(tag: string): string {
2121
}
2222

2323
/**
24-
* HTML-decodes a tag name so values stored with different encodings (e.g. `R&amp;D` vs `R&D`)
25-
* resolve to the same string. Mirrors getDecodedCategoryName in CategoryUtils.
24+
* HTML-decodes a tag name so values stored with different encodings are displayed correctly (e.g. `R&amp;D` vs `R&D`)
25+
* Mirrors getDecodedCategoryName in CategoryUtils.
2626
*/
2727
function getDecodedTagName(tagName: string): string {
2828
return Str.htmlDecode(tagName);

0 commit comments

Comments
 (0)