Skip to content

Auto expiring icons#28

Open
Edelor68 wants to merge 3 commits intoattrib:masterfrom
Edelor68:auto-expiring-icons
Open

Auto expiring icons#28
Edelor68 wants to merge 3 commits intoattrib:masterfrom
Edelor68:auto-expiring-icons

Conversation

@Edelor68
Copy link
Contributor

When a new feature is added the user can choose between a few presets of time until expiration or can enter a custom time.
I did not see a good way to implement users updating the time until expiration after the feature is already created without making the UI either misleading or cluttered, so for now when editing a feature the expiring section is disabled.

@attrib attrib self-requested a review March 2, 2026 19:34
Copy link
Owner

@attrib attrib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool change. Thanks for this! Like the cool interface.

Just a small suggestion added inline, what do you think about it? If you think the idea is stupid, we can use it like this.

* @param {WebSocket} client
*/
function sendFeatures(client) {
checkExpiredFeatures()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this to conquerUpdater

    .then((data) => {
      checkExpiredFeatures()
      if (data) {
        const payload = Object.assign(data, { oldVersion, warNumber: warapi.warData.warNumber })

this already runs regullary. then we do not have to add it to all send functions

}, 60_000)
for (const featureToCheck of features.features) {

const expireTime = featureToCheck.properties?.expireTime;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crazy idea:

instead of saving the expire time, we save the selected time.

and here we do const expireTime = featureToCheck.properties?.expire + new Date(expireTime).getTime()

then in select.js:

  clockColor = (clock, feature) => {
  if (NO_CLOCK.includes(feature.get('type'))) {

we replace the NO_CLOCK with featureToCheck.properties?.expireTime - so only show the clock if a expire is set.

and the clockColor then depends on time left till expired.

then we would have an option to reset the timer.

what do you think about this idea?

Copy link
Owner

@attrib attrib Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do it like this, we need to update the /help page (decay section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants