UX: add 'show nearby picture' in new point popup

This commit is contained in:
Pieter Vander Vennet 2025-04-28 15:09:17 +02:00
parent d56cf56511
commit dad9bb1349
8 changed files with 37 additions and 24 deletions

View file

@ -188,7 +188,7 @@
"tagRenderings": [
{
"id": "add_new",
"classes": "h-full flex special-add-new-point",
"classes": "max-h-leave-room special-add-new-point flex-1",
"condition": "has_presets=yes",
"render": {
"*": "{add_new_point()}"
@ -196,11 +196,19 @@
},
{
"id": "add_note",
"classes": "flex-1",
"condition": "has_note_layer=yes",
"render": {
"*": "{open_note()}"
}
},
{
"id": "nearby_images",
"classes": "w-fit self-end",
"render": {
"*": "{nearby_images(,true)}"
}
},
{
"id": "debug",
"metacondition": "__featureSwitchIsDebugging=true",

View file

@ -1390,11 +1390,6 @@ input[type="range"].range-lg::-moz-range-thumb {
margin-right: 0.25rem;
}
.mx-12 {
margin-left: 3rem;
margin-right: 3rem;
}
.mx-16 {
margin-left: 4rem;
margin-right: 4rem;
@ -5779,6 +5774,11 @@ svg.apply-fill path {
max-width: 100%;
}
.max-h-leave-room {
/* Leaves room for a single button, with padding */
max-height: calc(100% - 3.25rem);
}
.max-w-screen {
max-width: 100vw;
}
@ -8844,10 +8844,6 @@ svg.apply-fill path {
margin-right: 0px;
}
.lg\:w-1\/3 {
width: 33.333333%;
}
.lg\:w-5\/12 {
width: 41.666667%;
}

View file

@ -15,17 +15,18 @@ export default abstract class Script {
args.splice(0, 2)
const start = new Date()
this.main(args)
.then((_) => {
.catch((e) => {
console.log(`ERROR in script ${process.argv[1]}:`, e)
process.exit(1)
})
.then(() => {
const end = new Date()
const millisNeeded = end.getTime() - start.getTime()
const green = (s) => "\x1b[92m" + s + "\x1b[0m"
console.log(green("All done! (" + millisNeeded + " ms)"))
})
.catch((e) => {
console.log(`ERROR in script ${process.argv[1]}:`, e)
process.exit(1)
})
}
public printHelp() {

View file

@ -187,7 +187,7 @@ export default class LayerConfig extends WithContextLoader {
)
}
if (pr.snapToLayer !== undefined) {
let snapToLayers = pr.snapToLayer
const snapToLayers = pr.snapToLayer
preciseInput = {
snapToLayers,
maxSnapDistance: pr.maxSnapDistance ?? 10,
@ -277,8 +277,9 @@ export default class LayerConfig extends WithContextLoader {
tr["rewrite"] === undefined
) ?? []
if (missingIds?.length > 0 && official) {
console.error("Some tagRenderings of", this.id, "are missing an id:", missingIds)
throw "Missing ids in tagrenderings"
const msg = `Context: ${context}; Some tagRenderings of ${this.id} are missing an id: ${missingIds.map(x => JSON.stringify(x)).join(", ")} `
console.error(msg)
throw msg
}
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map(

View file

@ -144,9 +144,6 @@ export default class TagRenderingConfig {
this.classes = json.classes ?? []
}
this.classes = [].concat(...this.classes.map((cl) => cl.split(" ")))
if (this.classes.length === 0) {
this.classes = undefined
}
this.render = Translations.T(<any>json.render, translationKey + ".render")
this.question = Translations.T(json.question, translationKey + ".question")

View file

@ -64,7 +64,12 @@ export class WithSpecialLayers extends WithChangesState {
this.initActorsSpecialLayers()
this.drawSelectedElement()
this.drawSpecialLayers()
this.drawLastClick()
try {
this.drawLastClick()
} catch (e) {
console.error("FATAL: invalid last click layer", e)
throw e
}
// Note: the lock-range is handled by UserMapFeatureSwitchState
{
// Activate metatagging for the 'current_view' layer

View file

@ -86,9 +86,9 @@
{selectedElement}
{layer}
{highlightedRendering}
clss={$knownTagRenderings.length === 1
clss={($knownTagRenderings.length === 1
? "h-full"
: "tr-length-" + $knownTagRenderings.length}
: "tr-length-" + $knownTagRenderings.length)+" "+config.classes.join(" ")}
/>
{/each}
</div>

View file

@ -674,6 +674,11 @@ svg.apply-fill path {
max-width: 100%;
}
.max-h-leave-room {
/* Leaves room for a single button, with padding */
max-height: calc(100% - 3.25rem);
}
.max-w-screen {
max-width: 100vw;
}