Access UUIDs in Panel Menu

Hey there,
I’d like to use the pages uuids as reference in the panel menu. Currently I have the following syntax for highlighted menu entries. But if the user currently changes the url of the page, the navigation will break. Any ideas?

'menu' => [
    'site' => [
      'label' => 'Hauptbereich',
      'icon' => 'dashboard',
      'current' => function (string $current): bool {
        $path = Kirby::instance()->request()->path()->toString();
        return $current === 'site' 
        && Str::contains($path, 'pages/galleries') === false
        && Str::contains($path, 'pages/uber-uns') === false
        && Str::contains($path, 'pages/podcasts') === false
        ;
      },
    ],
    'galleries' => [
      'label' => 'Galerien',
      'link' => 'pages/galleries/',
      'icon' => 'image',
      'current' => function (string $current): bool {
        $path = Kirby::instance()->request()->path()->toString();
        return Str::contains($path, 'pages/galleries');
      }
    ],
    '-',
    'podcasts' => [
      'label' => 'Podcasts',
      'link' => 'pages/podcasts',
      'icon' => 'audio',
      'current' => function (string $current): bool {
        $path = Kirby::instance()->request()->path()->toString();
        return Str::contains($path, 'pages/podcasts');
      }
    ],
    'about-us' => [
      'label' => 'Über uns',
      'link' => 'pages/uber-uns',
      'icon' => 'user',
      'current' => function (string $current): bool {
        $path = Kirby::instance()->request()->path()->toString();
        return Str::contains($path, 'pages/uber-uns');
      }
    ],

Not tested but I think you can achive via accessing to $kirby object in menu array like in doc:

Not solving it via just checking parts of the path makes it a bit more complicated as you have to check for multiple case (exact page, descendant of the page or file of any of those).

But the current callback could look something like

$path = App::instance()->path();
try {
	$model  = Find::parent(Str::after($path,'panel/'));
	$parent = page('page://theUUID');

	if ($model instanceof File) {
		$model = $model->page();
	}

	if ($model instanceof Page) {
		return
		$model->is($parent) ||
		$model->isDescendantOf($parent);
	}
} catch (Exception) {}

return false;

For the site callback, this would need to cover the negative of all of these then.

Make sure to have the following at the top of the file, so it uses the right classes:

use Kirby\Cms\App;
use Kirby\Cms\File;
use Kirby\Cms\Find;
use Kirby\Cms\Page;
use Kirby\Toolkit\Str;