Skip to content

[Bug] PermissionViewer: Discord start/restart/reload causes formatting problem #844

Open

Description

@wilecoyote

Which plugin/theme is this about?
PermissionViewer v1.0.1

Describe the Bug
On Discord start/restart and reload the formatting of permissions looks weird. When you reactivate the plugin after starting/restarting or reloading, it is shown correctly.

To Reproduce
Start discord with the PermissionViewer plugin activated, click on a user and look at the user pop-out.

Expected Behavior
The formatting should be correct on start/restart/reload.

Screenshots
Image

Discord Version
Stable 559653 (3c20cde)

Additional Context
Problem #839 was closed but the formatting issue still exists

Activity

  1. changed the title [-][Bug] PermissionViewer: Restart/Reload Causes de-formatting problem[/-] [+][Bug] PermissionViewer: Discord start/restart/reload causes formatting problem[/+] on Jun 10, 2026
  2. XxUnkn0wnxX commented on Jun 14, 2026

    @XxUnkn0wnxX

    I was able to reproduce this as a cold-boot timing issue.

    On Discord startup/reload, PermissionsViewer builds/caches the popout permission HTML before Discord has loaded the user-popout role pill class module. That leaves the generated popout markup with missing/stale Discord class names, so the permission pills render warped.

    Disabling and re-enabling the plugin fixes it because Discord has already rendered user popouts/roles by then, so the role classes are available.

    A cleaner fix is to avoid caching the popout templates in onStart(). Instead:

    • resolve the popout role classes when a user popout is actually rendered
    • wait/retry briefly only until the structural role classes are present
    • optionally copy class names from the live popout role DOM when available
    • cache the first valid template set after Discord has loaded the real classes
    • strip unresolved optional template placeholders so {{...}} tokens cannot leak into the DOM

    The important classes are the structural role pill ones like role and roleCircle; optional typography/container classes should not block rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions