v0.8.3

RightNow-AI/openfangv0.8.3May 19, 2025by svilenmarkov

AI Summary

This release introduces new utility functions to the custom API widget, such as `mod`, `safeHTML`, and `.Options.JSON`, to facilitate more complex request handling. Additionally, it enhances theming controls by allowing users to disable the theme picker and apply styles dynamically using the new document root theme key.

Key Highlights

  • Added `.Options.JSON` function to send nested JSON in request bodies
  • Added `safeHTML` and `mod` functions to the custom API widget
  • Added `disable-picker: true` option to the theme configuration
  • Added theme key to document root for dynamic CSS styling based on theme
  • Fixed `HTTP_PROXY` and `HTTPS_PROXY` environment variables not being used

New Features

  • .Options.JSON function
  • safeHTML function
  • mod function
  • disable-picker: true option
  • Document root theme key injection

Full Release Notes

## New

* Added the ability to disable the theme picker via `disable-picker: true` under `theme` (thanks @NeoNyaa) 
* Added `mod` function (modulo) to the custom API widget (thanks @anant-j)
* Added `safeHTML` function to the custom API widget which prevents HTML from being escaped (thanks @sudoexec)
* Added `.Options.JSON` to the custom API widget which takes any nested option value and turns it into a JSON string (thanks @ralphocdol)

<details>
  <summary>View example</summary>

```yaml
- type: custom-api
  options: 
    request-body: 
      service: Session
      method: login
      params: 
        username: ${USERNAME}
        password: ${PASSWORD}

  # useful if you need to send JSON in a request body
  template: |
    ...
    | withStringBody (.Options.JSON "request-body")
    ...
```

</details>

* Added the theme key to the document root so that you can apply styles based on the selected theme (thanks @EricKotato)

<details>
  <summary>View example</summary>

```css
:root[data-theme="default-dark"] {
    .color-primary-if-not-visited {
        color: #ff0000;
    }
}

:root[data-theme="default-light"] {
    .color-primary-if-not-visited {
        color: #00ff00;
    }
}

:root[data-theme="your-theme-name"] {
    .color-primary-if-not-visited { 
        color: #0000ff;
    }
}
```
</details>

## Fixes

* Fixed `HTTP_PROXY` and `HTTPS_PROXY` environment variables not getting used (thanks @mazzz1y) 
* Fixed truncated links' hover text having unnecessary whitespace (thanks @ralphocdol)

[Visit the release notes for v0.8.0 to learn about all new features](https://github.com/glanceapp/glance/releases/tag/v0.8.0)