@lofenta/cli 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  All notable changes to the `lofenta` CLI. Versions before 0.5.0 were
4
4
  reconstructed from the internal task history when this file was introduced.
5
5
 
6
+ ## 0.5.2 - 2026-11-03
7
+
8
+ ### Fixed
9
+ - Interactive menus (project picker, main menu) now auto-paginate to the terminal height, so accounts with many projects no longer overflow off the top of the screen. Previously only the template browser paginated; every other menu rendered all items at once. Left/Right page through, and the footer shows "Page X/Y".
10
+
6
11
  ## 0.5.1 - 2026-11-03
7
12
 
8
13
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lofenta/cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Lofenta CLI: deploy apps and manage projects, env vars, domains, logs, databases and more from your terminal.",
5
5
  "keywords": ["lofenta", "paas", "deploy", "cli", "hosting", "devops", "containers"],
6
6
  "homepage": "https://lofenta.com",
package/src/index.js CHANGED
@@ -1521,19 +1521,21 @@ async function handleDeploy(config, flags, positionals) {
1521
1521
  }
1522
1522
 
1523
1523
  async function selectMenu({ title, subtitle, items, config = loadConfig(), pageSize = 0 }) {
1524
- // Pagination kicks in when the caller explicitly sets pageSize and the list overflows.
1525
- // Without a pageSize the menu renders all items at once (legacy behavior for the main
1526
- // shell where we want everything visible). With pagination, Left/Right walk pages and
1527
- // Up/Down still walks the current page; the selected index is global so when we change
1528
- // page we land on the first item of the new page.
1529
- const usingPages = pageSize > 0 && items.length > pageSize
1530
- const pages = usingPages ? Math.ceil(items.length / pageSize) : 1
1524
+ // Pagination auto-sizes to the terminal height so long lists never scroll off the
1525
+ // top (e.g. an account with many projects). An explicit pageSize (the template
1526
+ // browser) still wins. Left/Right walk pages, Up/Down walks the current page; the
1527
+ // selected index is global, so changing page lands on the first item of the new page.
1528
+ const termRows = stdout.rows && stdout.rows > 0 ? stdout.rows : 24
1529
+ const headerRows = BRAND_MARK.length + 6 // brand art + title/subtitle/base-url + footer
1530
+ const effectivePageSize = pageSize > 0 ? pageSize : Math.max(4, termRows - headerRows)
1531
+ const usingPages = items.length > effectivePageSize
1532
+ const pages = usingPages ? Math.ceil(items.length / effectivePageSize) : 1
1531
1533
  let selected = 0
1532
1534
  let page = 0
1533
1535
  const visibleRange = () => {
1534
1536
  if (!usingPages) return [0, items.length]
1535
- const start = page * pageSize
1536
- return [start, Math.min(start + pageSize, items.length)]
1537
+ const start = page * effectivePageSize
1538
+ return [start, Math.min(start + effectivePageSize, items.length)]
1537
1539
  }
1538
1540
 
1539
1541
  return new Promise((resolve) => {
@@ -1615,13 +1617,13 @@ async function selectMenu({ title, subtitle, items, config = loadConfig(), pageS
1615
1617
 
1616
1618
  if (usingPages && key.name === "right") {
1617
1619
  page = (page + 1) % pages
1618
- selected = page * pageSize
1620
+ selected = page * effectivePageSize
1619
1621
  render()
1620
1622
  return
1621
1623
  }
1622
1624
  if (usingPages && key.name === "left") {
1623
1625
  page = (page - 1 + pages) % pages
1624
- selected = page * pageSize
1626
+ selected = page * effectivePageSize
1625
1627
  render()
1626
1628
  return
1627
1629
  }