Skip to content

Commit

Permalink
Show window id in UI in beta mode (if errorbox is enabled)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jun 16, 2023
1 parent 5352751 commit a477f3a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
19 changes: 19 additions & 0 deletions app/bibleview-js/src/components/BibleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<AmbiguousSelection ref="ambiguousSelection"/>
</template>
<ErrorBox v-if="appSettings.errorBox"/>
<div class="window-id" v-if="appSettings.errorBox">{{appSettings.windowId}}</div>
<DevelopmentMode :current-verse="currentVerse" v-if="config.developmentMode"/>
<div v-if="calculatedConfig.topMargin > 0" class="top-margin" :style="`height: ${calculatedConfig.topOffset}px;`"/>
<div v-if="appSettings.hasActiveIndicator">
Expand Down Expand Up @@ -484,4 +485,22 @@ a {
text-decoration: none;
display: inline-block;
}

.window-id {
top: var(--top-offset);
position: fixed;
padding: 0.5em;
color: red;

[dir=ltr] & {
right: 0;
}

[dir=rtl] & {
left: 0;
}

width: 5em;
height: 1em;
}
</style>
2 changes: 2 additions & 0 deletions app/bibleview-js/src/composables/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export type AppSettings = {
hasActiveIndicator: boolean,
activeSince: number,
limitAmbiguousModalSize: boolean,
windowId: IdType,
}

export type CalculatedConfig = Ref<{
Expand Down Expand Up @@ -175,6 +176,7 @@ export function useConfig(documentType: Ref<BibleViewDocumentType>) {
hasActiveIndicator: false,
activeSince: 0,
limitAmbiguousModalSize: false,
windowId: "",
});

function calcMmInPx() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Window (
val isPrimaryLinksWindow get() = isLinksWindow && id == windowRepository.primaryTargetLinksWindowId

val id = entity.id
val displayId = id.toString().substring(0, 4)
val displayId = id.toString().substring(0, 5)

var weight: Float
get() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,9 @@ class BibleView(val mainBibleActivity: MainBibleActivity,
recentLabels: $recentLabels,
hideCompareDocuments: $hideCompareDocuments,
limitAmbiguousModalSize: $limitAmbiguousModalSize,
windowId: '${window.displayId}',
},
initial: $initial
initial: $initial,
});
"""
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/net/bible/service/common/CommonUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ object CommonUtils : CommonUtilsBase() {
val isBeta: Boolean get() {
val verFull = applicationVersionName
val ver = verFull.split("#")[0]
return ver.endsWith("-beta") or ver.endsWith("-alpha")
return ver.endsWith("-beta") || ver.endsWith("-alpha") || application.packageName.endsWith(".next") || isDebugMode
}

val applicationVersionNumber: Int
Expand Down

0 comments on commit a477f3a

Please sign in to comment.