Skip to content

Commit

Permalink
Merge branch 'master' into cross-tab
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis authored Jan 27, 2025
2 parents 68bd4b8 + 7795ac5 commit ab91830
Show file tree
Hide file tree
Showing 19 changed files with 285 additions and 220 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

## 8.56.0 <span class="changelog-date">(2025-01-26)</span>

## 8.55.0 <span class="changelog-date">(2025-01-19)</span>

* Restored a workaround for laggy dragging in Chrome on Windows when using some high-DPI and/or Logitech mice.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dim",
"version": "8.55.0",
"version": "8.56.0",
"description": "An item manager for Destiny.",
"main": "app/index.html",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/app/dim-ui/PageWithMenu.m.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
.menuHeader {
margin-bottom: 4px;
padding-bottom: 1px;
margin-top: 8px;
margin-top: 20px;
letter-spacing: 1px;
text-transform: uppercase;
border-bottom: 0.5px solid #666;
Expand Down
4 changes: 3 additions & 1 deletion src/app/inventory-page/PhoneStores.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ function StoresInventory({
<>
{((!store.isVault && selectedCategoryId === 'Armor') ||
(store.isVault && selectedCategoryId === 'Inventory')) && (
<StoreStats store={store} style={{ paddingBottom: 8 }} />
<div className="store-cell" style={{ paddingBottom: 8 }}>
<StoreStats store={store} />
</div>
)}
{showPostmaster && buckets.byCategory.Postmaster.map(renderBucket)}
{buckets.byCategory[selectedCategoryId].map(renderBucket)}
Expand Down
21 changes: 3 additions & 18 deletions src/app/inventory/d2-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ export function loadStores({
};
}

/** time in milliseconds after which we could expect Bnet to return an updated response */
const BUNGIE_CACHE_TTL = 15_000; // TODO: use a latch
/** How old the profile can be and still trigger cleanup of tags. */
const FRESH_ENOUGH_TO_CLEAN_INFOS = 90_000; // 90 seconds

Expand Down Expand Up @@ -232,22 +230,9 @@ function loadProfile(
}
}

let cachedProfileMintedDate = new Date(0);

// If our cached profile is up to date
if (cachedProfileResponse) {
// TODO: need to make sure we still load at the right frequency / for manual cache busts?
cachedProfileMintedDate = new Date(cachedProfileResponse.responseMintedTimestamp ?? 0);
const profileAge = Date.now() - cachedProfileMintedDate.getTime();
if (!storesLoadedSelector(getState()) && profileAge > 0 && profileAge < BUNGIE_CACHE_TTL) {
warnLog(
TAG,
`Cached profile is only ${profileAge / 1000}s old, skipping remote load.`,
profileAge,
);
return { profile: cachedProfileResponse, live: false };
}
}
const cachedProfileMintedDate = cachedProfileResponse
? new Date(cachedProfileResponse.responseMintedTimestamp ?? 0)
: new Date(0);

try {
const remoteProfileResponse = await getStores(account);
Expand Down
4 changes: 2 additions & 2 deletions src/app/item-feed/Highlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'app/utils/socket-utils';
import clsx from 'clsx';
import { BucketHashes, PlugCategoryHashes } from 'data/d2/generated-enums';
import '../store-stats/CharacterStats.scss';
import '../store-stats/CharacterStats.m.scss';
import styles from './Highlights.m.scss';

/**
Expand Down Expand Up @@ -74,7 +74,7 @@ export default function Highlights({ item }: { item: DimItem }) {
return (
<>
{item.bucket.hash !== BucketHashes.ClassArmor && (
<div className={clsx(styles.stats, 'stat-bars', 'destiny2')}>
<div className={clsx(styles.stats, 'stat-bars')}>
<div className={clsx('stat-row', styles.armorStats)}>
{item.stats?.filter((s) => s.statHash > 0).map(renderStat)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/loadout/loadout-edit/LoadoutEditBucket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function ArmorExtras({
return (
<>
{equippedItems.length === 5 && (
<div className="stat-bars destiny2">
<div className="stat-bars">
<LoadoutCharacterStats
loadout={loadout}
subclass={subclass}
Expand Down
2 changes: 1 addition & 1 deletion src/app/loadout/loadout-ui/LoadoutItemCategorySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function LoadoutItemCategorySection({
{items && isArmor && (
<>
{equippedItems.length === 5 && (
<div className="stat-bars destiny2">
<div className="stat-bars">
<LoadoutCharacterStats
loadout={loadout}
subclass={subclass}
Expand Down
134 changes: 134 additions & 0 deletions src/app/store-stats/CharacterStats.m.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
@use '../variables' as *;

@layer base {
:global(.stat) {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
margin-right: 2px;
line-height: 16px;
white-space: nowrap;
&:last-child {
margin-right: 0;
}
img {
height: 14px;
width: 14px;
margin-right: 2px;
opacity: 1;
}
}

/* INT/DIS/STR bars */
:global(.stat-bars) {
width: 100%;
max-width: 230px;
display: flex;
justify-content: space-around;
margin-top: 8px;
opacity: 1;
flex-direction: column;

@include phone-portrait {
margin-left: auto;
margin-right: auto;
align-items: center;
}

> div {
flex: 1;
display: flex;
flex-direction: row;
}

:global(.stat) {
flex: 0;
font-size: 11px;
color: var(--theme-header-characters-txt);
&.boostedValue {
color: $stat-modded;
font-weight: bold;
text-shadow: rgba(0, 0, 0, 0.5) 0 0 2px;
}
:global(.phone-portrait) & {
font-size: 12px;
}
}
}

// D2 stats row. Used here and in the item feed.
:global(.stat-row) {
display: flex;
flex-direction: row;
place-items: center left;

@include phone-portrait {
width: 100%;
justify-content: center;
}

&:nth-child(n + 2) {
justify-content: space-between;
}
}
}

.powerFormula {
margin-bottom: 3px;
img {
opacity: 0.6;
height: 17px;
width: 17px;
}
img[src^='data'] {
filter: invert(1);
}
> div:nth-child(2) {
display: flex;
flex-direction: row;
&::before,
&::after {
font-size: 13px;
color: var(--theme-header-characters-txt);
margin-left: 4px;
margin-right: 4px;
text-decoration: none !important;
}
&::before {
content: '=';
}
&::after {
content: '+';
}
}
}

.powerStat {
font-size: 125%;
}

.tier {
font-weight: bold;
}

.tooltipFootnote {
opacity: 0.6;
width: 80%;
margin: 10px 0 0 auto;
text-align: right;
}

.richTooltipWrapper {
margin: 8px 0 0 0;
}

.asterisk {
vertical-align: top;
margin-left: 2px;
}

.dropLevel {
display: flex;
justify-content: space-between;
}
14 changes: 14 additions & 0 deletions src/app/store-stats/CharacterStats.m.scss.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab91830

Please sign in to comment.