v0.4.0

glanceapp/glancev0.4.0May 12, 2024by svilenmarkov

AI Summary

This release focuses on layout flexibility and content variety, adding a Repository widget, new card styles for RSS and Videos, and improved sorting for social news widgets.

Key Highlights

  • Introduced a Repository widget to monitor open-source projects.
  • Added experimental dynamic columns style for bookmarks, monitor, and stocks.
  • Added grid-cards style for the Videos widget.
  • Introduced sorting options for Reddit and Hacker News widgets.
  • Added mobile header support to push content down on tall screens.

Breaking Changes

  • The default sort order for Reddit and Hacker News widgets changed from a custom engagement algorithm to the native site order.
  • The default sort order for the Stocks widget changed from absolute change to definition order.

New Features

  • Repository widget.
  • Dynamic columns experimental style.
  • Horizontal cards 2 style for RSS.
  • Grid cards style for Videos.
  • Mobile header property.
  • Sorting options for Reddit (top/month) and Hacker News.
  • Symbol and chart links for stocks.
  • Environment variable support for Monitor URLs.

Full Release Notes

## New

### Repository widget

For those who like keeping an eye on their open source projects:

![repository-overview-preview](https://github.com/glanceapp/glance/assets/7613769/16f7e9bc-fe62-4123-a7c5-7e85b853eeea)

```yaml
- type: repository
  repository: glanceapp/glance
  pull-requests-limit: 3
  issues-limit: 3
```

Hiding the pull requests or issues is possible by setting their limit to `-1`.

### Experimental dynamic columns style for the bookmarks, monitor and stocks widgets

The three widgets have so far been primarily built to fit inside a `small` column, leaving lots to be desired when placed inside of a `full` column. There is now an experimental `dynamic-columns-experimental` style for all 3, giving you more flexibility in how you build your pages:

> [!NOTE]
>
> Because this is experimental, the looks or behavior of this may change in the future depending on feedback.


https://github.com/glanceapp/glance/assets/7613769/35723264-d33c-4f43-b34c-f25898c21e67


```yaml
- size: full
  widgets:
    - type: monitor
      style: dynamic-columns-experimental
      ...

    - type: stocks
      style: dynamic-columns-experimental
      ...

    - type: bookmarks
      style: dynamic-columns-experimental
      ...
```

(thanks for the idea @igeekbb & @allardhs)

### RSS widget: `horizontal-cards-2` style

For when the thumbnail is the main attraction:

![rss-widget-horizontal-cards-2-preview](https://github.com/glanceapp/glance/assets/7613769/7b0dca3b-e91a-4695-a002-b9ad926e4613)

You can adjust the height of the cards (for just this style) using the new `card-height` property:

```yaml
- type: rss
  style: horizontal-cards-2
  card-height: 25 # in rems, where 1rem = 10px, so this would be 250px tall
  feeds: ...
```

A similar and newly added `thumbnail-height` can also be used to change the height of just the thumbnail for the `horizontal-cards` style.

### Videos widget: `grid-cards` style

![videos-widget-grid-cards-preview](https://github.com/glanceapp/glance/assets/7613769/0b6de04e-7cb6-4e95-915b-a62e6b67d782)

### Mobile header

Phones have gotten fairly tall, so tall in fact that trying to reach a link at the top of the page can sometimes be a pain. The new `show-mobile-header` property, available for each page, can help push the content down and make it easier to get to:

![mobile-header-preview](https://github.com/glanceapp/glance/assets/7613769/333a0e79-cfc6-46e1-8130-8f26fbdf7766)

```yaml
- name: Homelab
  show-mobile-header: true
  columns: ...
```

### Sorting options for Reddit and Hacker News

```yaml
- type: reddit
  title: Cool projects from /r/selfhosted this month
  subreddit: selfhosted
  sort-by: top
  top-period: month
  search: flair:"Release"
  show-thumbnails: true
```

![](https://github.com/glanceapp/glance/assets/7613769/2d7be6d9-82fc-4936-a77c-18c6abb766b3)

*(results are not rigged, I swear)*

Hacker news is a little more limited for now, allowing you to specify just `sort-by` with either `top`, `new` or `best`:

```yaml
- type: hacker-news
  sort-by: new
```

(thanks for the suggestion @NoxesP & @knhash)

### Symbol and chart links for stocks
You can now set a custom link for when you click on either the symbol or the chart of a stock:

```yaml
- type: stocks
  stocks:
    - symbol: AAPL
      name: Apple
      symbol-link: https://www.google.com/search?tbm=nws&q=apple
      chart-link: https://www.tradingview.com/chart/?symbol=NASDAQ:AAPL
```

(thanks for the idea @0x3e4)

### Specifying URLs for the Monitor widget from environment variables

```yaml
- type: monitor
  sites:
    - title: Jellyfin
      url: ${URL_TO_JELLYFIN}
```

(thanks for the idea @devsjc)

## Changed

### Sort order for Reddit and Hacker News

You've probably noticed that Glance doesn't return posts in the order you'd find them in either Reddit or Hacker news. This was undocumented bevahior which attempted to place posts with above average points and comments higher, since by default you only see up to 5 posts. This sorting behavior is no longer the default and you'll now see posts in the exact order they are found on each site.

If you liked the way posts were being ordered you can still use the same sorting algorithm via the new `extra-sort-by` property which is available for both the Reddit and Hacker News widgets:

```yaml
extra-sort-by: engagement
```

Note that `engagement` is currently the only possible option and other sorting algorithms may get added in the future.

### Images now fade in when they load

If you're a Firefox user you may have noticed the jarring way in which it loads images, where it sometimes places a white background behind the image as it gets loaded:

(connection speed throttled to exaggerate issue)

https://github.com/glanceapp/glance/assets/7613769/b7f1242c-9947-4f12-8677-405e14e1ba7a

To make the experience a little more pleasant, images will now be hidden until they've loaded completely and then fade in:

https://github.com/glanceapp/glance/assets/7613769/e6911dc5-7f21-42c4-b308-38d0e30ef7e1