detached a1e4979

feat(permission): add dialog text for website_data_access permission

commit
a1e4979beedc03111cec0d7b3f4668292ebcb65c
author
brice · · 2026-03-17 19:10 UTC
parent
09f434a
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -0
M internal/ui/dialog/permission.go +10 -0
@@ -130,6 +130,7 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
130130 hasMic := false
131131 hasCam := false
132132 hasDisplay := false
133+ hasDataAccess := false
133134
134135 for _, pt := range permTypes {
135136 switch pt {
@@ -139,6 +140,8 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
139140 hasCam = true
140141 case entity.PermissionTypeDisplay:
141142 hasDisplay = true
143+ case entity.PermissionTypeWebsiteDataAccess:
144+ hasDataAccess = true
142145 }
143146 }
144147
@@ -157,6 +160,8 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
157160 return "Allow Camera Access?"
158161 case hasDisplay:
159162 return "Allow Screen Sharing?"
163+ case hasDataAccess:
164+ return "Allow Third-Party Data Access?"
160165 default:
161166 return "Allow Permission?"
162167 }
@@ -167,6 +172,7 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
167172 hasMic := false
168173 hasCam := false
169174 hasDisplay := false
175+ hasDataAccess := false
170176
171177 for _, pt := range permTypes {
172178 switch pt {
@@ -176,6 +182,8 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
176182 hasCam = true
177183 case entity.PermissionTypeDisplay:
178184 hasDisplay = true
185+ case entity.PermissionTypeWebsiteDataAccess:
186+ hasDataAccess = true
179187 }
180188 }
181189
@@ -195,6 +203,8 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
195203 action = "access your camera"
196204 case hasDisplay:
197205 action = "share your screen"
206+ case hasDataAccess:
207+ action = "access its stored data while you browse this site"
198208 default:
199209 action = "access your device"
200210 }
@@ -130,6 +130,7 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
130 hasMic := false130 hasMic := false
131 hasCam := false131 hasCam := false
132 hasDisplay := false132 hasDisplay := false
133+ hasDataAccess := false
133 134
134 for _, pt := range permTypes {135 for _, pt := range permTypes {
135 switch pt {136 switch pt {
@@ -139,6 +140,8 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
139 hasCam = true140 hasCam = true
140 case entity.PermissionTypeDisplay:141 case entity.PermissionTypeDisplay:
141 hasDisplay = true142 hasDisplay = true
143+ case entity.PermissionTypeWebsiteDataAccess:
144+ hasDataAccess = true
142 }145 }
143 }146 }
144 147
@@ -157,6 +160,8 @@ func (d *PermissionDialog) buildHeading(permTypes []entity.PermissionType) strin
157 return "Allow Camera Access?"160 return "Allow Camera Access?"
158 case hasDisplay:161 case hasDisplay:
159 return "Allow Screen Sharing?"162 return "Allow Screen Sharing?"
163+ case hasDataAccess:
164+ return "Allow Third-Party Data Access?"
160 default:165 default:
161 return "Allow Permission?"166 return "Allow Permission?"
162 }167 }
@@ -167,6 +172,7 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
167 hasMic := false172 hasMic := false
168 hasCam := false173 hasCam := false
169 hasDisplay := false174 hasDisplay := false
175+ hasDataAccess := false
170 176
171 for _, pt := range permTypes {177 for _, pt := range permTypes {
172 switch pt {178 switch pt {
@@ -176,6 +182,8 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
176 hasCam = true182 hasCam = true
177 case entity.PermissionTypeDisplay:183 case entity.PermissionTypeDisplay:
178 hasDisplay = true184 hasDisplay = true
185+ case entity.PermissionTypeWebsiteDataAccess:
186+ hasDataAccess = true
179 }187 }
180 }188 }
181 189
@@ -195,6 +203,8 @@ func (d *PermissionDialog) buildBody(origin string, permTypes []entity.Permissio
195 action = "access your camera"203 action = "access your camera"
196 case hasDisplay:204 case hasDisplay:
197 action = "share your screen"205 action = "share your screen"
206+ case hasDataAccess:
207+ action = "access its stored data while you browse this site"
198 default:208 default:
199 action = "access your device"209 action = "access your device"
200 }210 }
M internal/ui/dialog/permission_test.go +6 -0
@@ -142,6 +142,12 @@ func TestPermissionDialog_BuildHeadingAndBody_DisplayCombinations(t *testing.T)
142142 expectHeading: "Allow Microphone, Camera, and Screen Sharing?",
143143 expectedAction: "access your microphone and camera, and share your screen",
144144 },
145+ {
146+ name: "website data access only",
147+ permTypes: []entity.PermissionType{entity.PermissionTypeWebsiteDataAccess},
148+ expectHeading: "Allow Third-Party Data Access?",
149+ expectedAction: "access its stored data while you browse this site",
150+ },
145151 }
146152
147153 for _, tt := range tests {
@@ -142,6 +142,12 @@ func TestPermissionDialog_BuildHeadingAndBody_DisplayCombinations(t *testing.T)
142 expectHeading: "Allow Microphone, Camera, and Screen Sharing?",142 expectHeading: "Allow Microphone, Camera, and Screen Sharing?",
143 expectedAction: "access your microphone and camera, and share your screen",143 expectedAction: "access your microphone and camera, and share your screen",
144 },144 },
145+ {
146+ name: "website data access only",
147+ permTypes: []entity.PermissionType{entity.PermissionTypeWebsiteDataAccess},
148+ expectHeading: "Allow Third-Party Data Access?",
149+ expectedAction: "access its stored data while you browse this site",
150+ },
145 }151 }
146 152
147 for _, tt := range tests {153 for _, tt := range tests {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close