Skip to content

Commit f444507

Browse files
committed
Hoist _CollapsibleSection import to fix ruff F821
The lazy import I added inside ``_wrap_collapsed`` worked at runtime but tripped ruff F821 because the forward-reference string in the return annotation pointed at a name that wasn't visible at module scope. Promote the import to the top alongside ``_t`` and drop the quoted return type — same behaviour, no shadowing risk, ruff clean.
1 parent 0c60c8f commit f444507

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

je_auto_control/gui/remote_desktop/webrtc_panel.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
)
2525

2626
from je_auto_control.gui._i18n_helpers import TranslatableMixin
27-
from je_auto_control.gui.remote_desktop._helpers import _t
27+
from je_auto_control.gui.remote_desktop._helpers import (
28+
_CollapsibleSection, _t,
29+
)
2830
from je_auto_control.gui.remote_desktop.blanking_overlay import BlankingOverlay
2931
from je_auto_control.gui.remote_desktop.frame_display import _FrameDisplay
3032
from je_auto_control.gui.remote_desktop.remote_screen_window import (
@@ -1757,17 +1759,14 @@ def _update_quality_dot(self, snapshot: StatsSnapshot) -> None:
17571759
self._quality_dot.setToolTip(_t(tip_key))
17581760

17591761
def _wrap_collapsed(self, inner: QGroupBox,
1760-
title_key: str) -> "_CollapsibleSection":
1762+
title_key: str) -> _CollapsibleSection:
17611763
"""Wrap an existing groupbox in a collapsed-by-default container.
17621764
17631765
The inner group keeps its own translated title, so we just pass
17641766
it through the wrapper's body. Heavy / rarely-used groups
17651767
(manual SDP, remote files, sync) hide their bodies by default
17661768
so the panel doesn't scroll past the fold on a normal display.
17671769
"""
1768-
from je_auto_control.gui.remote_desktop._helpers import (
1769-
_CollapsibleSection,
1770-
)
17711770
section = _CollapsibleSection()
17721771
# Translate the wrapper title; the inner groupbox already has
17731772
# its own header so we strip its frame to avoid double chrome.

0 commit comments

Comments
 (0)