Skip to content

Commit

Permalink
Fix item name width not shrinking correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Nov 3, 2024
1 parent 030716c commit 34998ad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
42 changes: 23 additions & 19 deletions packages/common-ui/styles/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,16 @@ table.gear-items-table, table.food-items-table {
min-width: 23px;
}

td[col-id='itemname'] {
max-width: 1px;
// TODO: was this needed for some other reason? This is breaking shrinkability of item names.
//td[col-id='itemname'] {
// max-width: 1px;
//}
th[col-id='itemname'] {
width: max-content;
min-width: max-content;
max-width: unset;
margin-left: -73px;
position: relative;
}

td[col-id='mats'], td[col-id='wd'] {
Expand Down Expand Up @@ -1275,6 +1283,7 @@ table.gear-items-table, table.food-items-table {
flex-grow: 99;
overflow: hidden;
text-overflow: ellipsis;
width: 1px;
}

.remove-item-button, .remove-food-button {
Expand Down Expand Up @@ -2564,23 +2573,18 @@ gear-set-viewer {
}
}

//.item-name-holder-view {
// display: flex;
// flex-direction: row;
//
// span.item-name {
// flex-basis: 1px;
// flex-grow: 99;
// overflow: hidden;
// text-overflow: ellipsis;
// }
//
// span.item-alts {
// flex-basis: fit-content;
// flex-shrink: 0;
// flex-grow: 0;
// }
//}
.item-name-holder-view {
text-overflow: ellipsis;
overflow: hidden;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
>span {
vertical-align: middle;
}
}
}

.food-view-table {
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend/src/scripts/components/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,12 @@ export class GearItemsViewTable extends CustomTable<GearSlotItem, EquipmentSet>
getter: item => {
return item.item.name;
},
// renderer: (item) => {
// const name = item.item.name;
// const itemNameSpan = quickElement('span', ['item-name'], [shortenItemName(name)]);
// const out = quickElement('div', ['item-name-holder-view'], [itemNameSpan]);
// return out;
// },
renderer: (item) => {
const name = item;
const itemNameSpan = quickElement('span', ['item-name'], [shortenItemName(name)]);
const out = quickElement('div', ['item-name-holder-view'], [itemNameSpan]);
return out;
},
headerStyler: (_, colHeader) => {
// console.log("Item", item);
colHeader.classList.add('gear-items-view-item-header');
Expand Down
2 changes: 1 addition & 1 deletion packages/xivmath/src/xivconstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ export function formatAcquisitionSource(source: GearAcquisitionSource): string |
case "normraid":
return "Normal Raid";
case "extrial":
return "Extreme Trial";
return "Ex. Trial";
case "alliance":
return "Alliance Raid";
case "other":
Expand Down

0 comments on commit 34998ad

Please sign in to comment.