()
| 103 | ) |
| 104 | |
| 105 | drive_window.write_text(content, encoding="utf-8") |
| 106 | print(f" ✓ Applied Linux drawer entry to {drive_window.relative_to(WEBCLIENTS_DIR)}") |
| 107 | |
| 108 | |
| 109 | def patch_drive_app() -> None: |
| 110 | if not DRIVE_APP.exists(): |
| 111 | fail("Unable to find Drive App.tsx in current WebClients layout") |
| 112 | |
| 113 | app_content = DRIVE_APP.read_text(encoding="utf-8") |
| 114 | if "Proton Drive Linux owns native sync/settings controls in this rail." not in app_content: |
| 115 | app_content = app_content.replace( |
| 116 | "import { DRAWER_VISIBILITY } from '@proton/shared/lib/interfaces';\n", "", 1 |
| 117 | ) |
| 118 | app_content = replace_once( |
| 119 | app_content, |
| 120 | " showDrawerSidebar: userSettings.HideSidePanel === DRAWER_VISIBILITY.SHOW,\n", |
| 121 | " // Proton Drive Linux owns native sync/settings controls in this rail.\n" |
| 122 | " // Keep it visible by default so the Linux controls, Contacts,\n" |
| 123 | " // Calendar, and Referral entries are reachable in packaged\n" |
| 124 | " // desktop builds. The chevron can still collapse it.\n" |
| 125 | " showDrawerSidebar: true,\n", |
| 126 | "Drive drawer default visibility", |
| 127 | ) |
| 128 | DRIVE_APP.write_text(app_content, encoding="utf-8") |
no test coverage detected