4 Commits
0.5.8 ... 0.5.9

Author SHA1 Message Date
cda9914d50 add 0.5.9 2026-01-17 19:47:29 +00:00
3acefbfbe8 0.5.9 2026-01-17 19:46:44 +00:00
4d10c5c91e Readme show more 2026-01-17 19:45:59 +00:00
810ff6fe85 Readme Show more. 2026-01-17 19:45:26 +00:00
4 changed files with 92 additions and 3 deletions

View File

@@ -11,6 +11,12 @@ Sections:
---
## [0.5.9] - 2026-01-17
### Changed
- README is now collapsible with a preview by default (Show more / Show less).
- Improved mobile readability by keeping long README content contained without affecting the page layout.
## [0.5.8] - 2026-01-17
### Changed

View File

@@ -1,7 +1,7 @@
{
"domain": "bahmcloud_store",
"name": "Bahmcloud Store",
"version": "0.5.7",
"version": "0.5.9",
"documentation": "https://git.bahmcloud.de/bahmcloud/bahmcloud_store",
"platforms": ["update"],
"requirements": [],

View File

@@ -19,12 +19,15 @@ class BahmcloudStorePanel extends HTMLElement {
this._detailRepoId = null;
this._detailRepo = null;
this._readmeLoading = false;
this._readmeText = null;
this._readmeHtml = null;
this._readmeError = null;
// README UX (E2)
this._readmeExpanded = false;
this._readmeCanToggle = false;
this._refreshing = false;
this._installingRepoId = null;
@@ -201,6 +204,7 @@ class BahmcloudStorePanel extends HTMLElement {
this._readmeText = null;
this._readmeHtml = null;
this._readmeError = null;
this._readmeExpanded = false;
this._update();
return;
}
@@ -265,6 +269,8 @@ class BahmcloudStorePanel extends HTMLElement {
this._readmeText = null;
this._readmeHtml = null;
this._readmeError = null;
this._readmeExpanded = false;
this._readmeCanToggle = false;
this._update();
this._loadReadme(repoId);
@@ -282,15 +288,23 @@ class BahmcloudStorePanel extends HTMLElement {
if (resp?.ok && typeof resp.readme === "string" && resp.readme.trim()) {
this._readmeText = resp.readme;
this._readmeHtml = typeof resp.html === "string" && resp.html.trim() ? resp.html : null;
const lines = resp.readme.split(/\r?\n/).length;
this._readmeCanToggle = lines > 24 || resp.readme.length > 1600;
this._readmeExpanded = !this._readmeCanToggle;
} else {
this._readmeText = null;
this._readmeHtml = null;
this._readmeError = this._safeText(resp?.message) || "README not found.";
this._readmeCanToggle = false;
this._readmeExpanded = false;
}
} catch (e) {
this._readmeText = null;
this._readmeHtml = null;
this._readmeError = e?.message ? String(e.message) : String(e);
this._readmeCanToggle = false;
this._readmeExpanded = false;
} finally {
this._readmeLoading = false;
this._update();
@@ -442,6 +456,50 @@ class BahmcloudStorePanel extends HTMLElement {
display:block;
max-width:100%;
}
.readmeWrap{
margin-top:12px;
max-width:100%;
border:1px solid var(--divider-color);
border-radius:14px;
padding:12px;
background: rgba(0,0,0,.02);
position:relative;
overflow:hidden;
}
.readmeWrap.collapsed{
max-height:260px;
}
@media (min-width: 1024px){
.readmeWrap.collapsed{ max-height:340px; }
}
.readmeWrap.collapsed::after{
content:"";
position:absolute;
left:0; right:0; bottom:0;
height:64px;
background: linear-gradient(to bottom, rgba(0,0,0,0), var(--card-background-color));
pointer-events:none;
}
.readmeWrap.expanded{
max-height:70vh;
overflow:auto;
-webkit-overflow-scrolling:touch;
}
.readmeActions{
display:flex; justify-content:flex-end;
margin-top:10px;
}
button.link{
border:1px solid transparent;
background: transparent;
color: var(--bcs-accent);
padding:8px 10px;
}
button.link:hover{
border-color: rgba(30,136,229,.25);
background: rgba(30,136,229,.06);
}
.md th, .md td{
border: 1px solid var(--divider-color);
padding: 8px;
@@ -450,6 +508,7 @@ class BahmcloudStorePanel extends HTMLElement {
overflow-wrap:anywhere;
word-break:break-word;
}
</style>
<div class="mobilebar">
@@ -735,7 +794,14 @@ class BahmcloudStorePanel extends HTMLElement {
<div class="muted small">Rendered Markdown</div>
</div>
<div id="readmePretty" class="md" style="margin-top:12px;"></div>
<div class="readmeWrap ${this._readmeExpanded ? "expanded" : "collapsed"}">
<div id="readmePretty" class="md"></div>
</div>
${this._readmeCanToggle ? `
<div class="readmeActions">
<button class="link" id="btnReadmeToggle">${this._readmeExpanded ? "Show less" : "Show more"}</button>
</div>
` : ``}
<details>
<summary>Show raw Markdown</summary>
@@ -838,6 +904,7 @@ class BahmcloudStorePanel extends HTMLElement {
const btnUpdate = root.getElementById("btnUpdate");
const btnUninstall = root.getElementById("btnUninstall");
const btnRestart = root.getElementById("btnRestart");
const btnReadmeToggle = root.getElementById("btnReadmeToggle");
if (btnInstall) {
btnInstall.addEventListener("click", () => {
@@ -864,6 +931,13 @@ class BahmcloudStorePanel extends HTMLElement {
btnRestart.addEventListener("click", () => this._restartHA());
}
if (btnReadmeToggle) {
btnReadmeToggle.addEventListener("click", () => {
this._readmeExpanded = !this._readmeExpanded;
this._update();
});
}
const mount = root.getElementById("readmePretty");
if (!mount) return;

View File

@@ -13,3 +13,12 @@ a { color: inherit; }
.md { max-width: 100%; overflow-x: auto; }
.md table { display:block; max-width:100%; overflow-x:auto; }
.md img { max-width: 100%; height: auto; }
/* README UX (E2): collapsible preview (standalone page only) */
.readmeWrap{ border:1px solid #ddd; border-radius:10px; padding:12px; background: #f7f7f7; max-width:100%; }
.readmeWrap.collapsed{ max-height:260px; overflow:hidden; position:relative; }
.readmeWrap.collapsed::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:56px; background: linear-gradient(to bottom, rgba(247,247,247,0), #f7f7f7); pointer-events:none; }
.readmeWrap.expanded{ max-height:70vh; overflow:auto; }
.readmeActions{ display:flex; justify-content:flex-end; margin-top:10px; }
button.link{ border:none; background:transparent; padding:6px 10px; color:#1E88E5; }
button.link:hover{ text-decoration:underline; }