Skip to content

Commit b0609e3

Browse files
Release 1.2.0 (#4)
2 parents c98d805 + b0e32f2 commit b0609e3

File tree

6 files changed

+82
-19
lines changed

6 files changed

+82
-19
lines changed

CHANGES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Changelog
22

3+
## v1.2.0 (TBD)
4+
5+
- Added `icon_type` parameter for widgets: `fa` (Font Awesome, default) or `text` (for emoji/plain text)
6+
37
## v1.1.0 (2025-11-07)
48

59
- Added support for multiple config filenames: `.disco-devbar.yaml`, `.disco-devbar.yml`
610

7-
## v1.0.0 (2025-qq-05)
11+
## v1.0.0 (2025-11-05)
812

913
- Initial public release

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,34 @@
99

1010
# Welcome!
1111

12-
Development toolbar/banner for Symfony worktree-based workflows. Displays project information, links
13-
to tools, and ticket details in development environment.
12+
**DiscoDevBar** is a developer tool that adds a customizable toolbar/banner to your Symfony application,
13+
providing all-time access to essential development resources right from your browser. Perfect for
14+
streamlining your development workflow by keeping frequently-used tools, admin panels, and services
15+
just one click away.
16+
17+
## What is DiscoDevBar?
18+
19+
DiscoDevBar creates a persistent banner (typically placed at the top of your layout) that displays
20+
during development. It's highly configurable via YAML, allowing you to create custom buttons and
21+
links to anything you need: admin panels, database tools, email catchers, API documentation, or
22+
any other development resource.
23+
24+
### Perfect for Docker Environments
25+
26+
Since configuration is YAML-based, it's incredibly easy to generate dynamically when setting up new
27+
development environments. When using Docker or similar containerization, port numbers often change
28+
between setups - but with DiscoDevBar, you can regenerate the configuration file on each environment
29+
startup, ensuring all links always point to the correct ports and services.
1430

1531
## Features
1632

17-
- Widget-based configuration system via YAML
18-
- Displays milestone, PR, and ticket information
19-
- Quick links to admin panel, phpMyAdmin, Mailpit
20-
- Customizable icons, text, and links
21-
- Only loads in development environment
22-
- Zero production overhead
33+
- **Fully customizable via YAML** - Easy to configure and regenerate for different environments
34+
- **Flexible widget system** - Create buttons with Font Awesome icons, emoji, text labels, or any combination
35+
- **Display anything** - Add links to admin panels, database tools, email catchers, API docs, or any development resource
36+
- **Action buttons** - Direct access to frequently-used tools and services
37+
- **Environment-aware** - Only loads in development environment, zero production overhead
38+
- **Dynamic configuration** - Perfect for Docker setups where ports change - regenerate config on startup
39+
- **Customizable placement** - Position widgets on left or right side of the toolbar
2340

2441
## Requirements
2542

Resources/views/devbar.html.twig

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
{% if widget.target %}target="{{ widget.target }}"{% endif %}
1717
{% if widget.title %}title="{{ widget.title }}"{% endif %}>
1818
<span class="disco-devbar-link-content">
19-
{% if widget.icon %}<i class="fa-solid {{ widget.icon }}"></i>{% endif %}
19+
{% if widget.icon %}
20+
{% if widget.iconType.value == 'fa' %}
21+
<i class="fa-solid {{ widget.icon }}"></i>
22+
{% else %}
23+
{{ widget.icon }}
24+
{% endif %}
25+
{% endif %}
2026
{% if widget.text %}{{ widget.text }}{% endif %}
2127
</span>
2228
</a>
@@ -34,7 +40,13 @@
3440
{% if widget.target %}target="{{ widget.target }}"{% endif %}
3541
{% if widget.title %}title="{{ widget.title }}"{% endif %}>
3642
<span class="disco-devbar-link-content">
37-
{% if widget.icon %}<i class="fa-solid {{ widget.icon }}"></i>{% endif %}
43+
{% if widget.icon %}
44+
{% if widget.iconType.value == 'fa' %}
45+
<i class="fa-solid {{ widget.icon }}"></i>
46+
{% else %}
47+
{{ widget.icon }}
48+
{% endif %}
49+
{% endif %}
3850
{% if widget.text %}{{ widget.text }}{% endif %}
3951
</span>
4052
</a>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "marcin-orlowski/symfony-discodevbar",
33
"description": "Development toolbar/banner for Symfony project",
44
"type": "symfony-bundle",
5-
"version": "1.1.0",
5+
"version": "1.2.0",
66
"license": "MIT",
77
"keywords": [
88
"symfony",

src/Dto/IconType.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/* #############################################################################
6+
*
7+
* █▀▀▄ ▀ █▀▀▄ █▀▀▄
8+
* █ █ ▀█ ▄▀▀▄ ▄▀▀▄ ▄▀▀▄ █ █ ▄▀▀▄ █ █ █▀▀▄ ▄▀▀▄ █▄▀
9+
* █ █ █ ▀▄ █ █ █ █ █ █▀▀ █ █ █ █ ▄▄█ █
10+
* █▄▄▀ ▄█▄ ▀▄▄▀ ▀▄▄▀ ▀▄▄▀ █▄▄▀ ▀▄▄▀ ▀▄▀ █▄▄▀ ▀▄▄▀ █
11+
*
12+
* Customizable developer toolbar for Symfony projects
13+
*
14+
* @author Marcin Orlowski <mail (#) marcinOrlowski (.) com>
15+
* @copyright 2025 Marcin Orlowski
16+
* @license https://opensource.org/license/mit MIT
17+
* @link https://github.com/MarcinOrlowski/php-symfony-discodevbar
18+
*
19+
* ########################################################################## */
20+
21+
namespace MarcinOrlowski\DiscoDevBar\Dto;
22+
23+
enum IconType: string
24+
{
25+
case FONT_AWESOME = 'fa';
26+
case TEXT = 'text';
27+
}

src/Dto/Widget.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function __construct(
2828
public readonly string $url,
2929
public readonly string $target,
3030
public readonly string $title,
31-
public readonly bool $expand
31+
public readonly bool $expand,
32+
public readonly IconType $iconType = IconType::FONT_AWESOME
3233
) {
3334
}
3435

@@ -45,14 +46,16 @@ public static function fromArray(array $data): self
4546
$target = $data['target'] ?? '';
4647
$title = $data['title'] ?? '';
4748
$expand = $data['expand'] ?? false;
49+
$iconType = $data['icon_type'] ?? 'fa';
4850

4951
return new self(
50-
icon: \is_string($icon) ? $icon : '',
51-
text: \is_string($text) ? $text : '',
52-
url: \is_string($url) ? $url : '',
53-
target: \is_string($target) ? $target : '',
54-
title: \is_string($title) ? $title : '',
55-
expand: \is_bool($expand) ? $expand : false
52+
icon: \is_string($icon) ? $icon : '',
53+
text: \is_string($text) ? $text : '',
54+
url: \is_string($url) ? $url : '',
55+
target: \is_string($target) ? $target : '',
56+
title: \is_string($title) ? $title : '',
57+
expand: \is_bool($expand) ? $expand : false,
58+
iconType: IconType::tryFrom(\is_string($iconType) ? $iconType : 'fa') ?? IconType::FONT_AWESOME
5659
);
5760
}
5861
}

0 commit comments

Comments
 (0)