Enforce more modal behavior on edit view dialogs (BL-16376)#7959
Enforce more modal behavior on edit view dialogs (BL-16376)#7959StephenMcConnel wants to merge 2 commits into
Conversation
|
| Filename | Overview |
|---|---|
| src/BloomBrowserUI/bookEdit/ProcessVideoProgressDialog.tsx | Adds a useEffect to post modal state to the C# layer when isOpen changes; missing required justification comment per AGENTS.md. |
| src/BloomBrowserUI/bookEdit/bookAndPageSettings/BookAndPageSettingsDialog.tsx | Adds a guarded useEffect to post modal state when the dialog opens/closes; missing required justification comment per AGENTS.md. |
| src/BloomBrowserUI/react_components/BookGridSetup/BookGridSetupDialog.tsx | Adds a guarded useEffect to post modal state when the dialog opens/closes; missing required justification comment per AGENTS.md. |
| src/BloomBrowserUI/react_components/LinkTargetChooser/LinkTargetChooserDialog.tsx | Adds a guarded useEffect with a justifying comment to enforce modal state; correctly follows AGENTS.md pattern. |
| src/BloomExe/Edit/EditingView.cs | Extends SetModalState to also call _workspaceView?.SetTabsEnabled, disabling workspace navigation tabs while any modal dialog is open. |
| src/BloomExe/web/controllers/CollectionApi.cs | Removes explicit HttpUtility.UrlDecode calls from HandleBookFileRequest; correct because RequiredParam already returns values decoded by HttpUtility.ParseQueryString, so the old code was double-decoding. |
Reviews (8): Last reviewed commit: "Enforce better modal behavior for edit v..." | Re-trigger Greptile
8b36be9 to
c74da97
Compare
StephenMcConnel
left a comment
There was a problem hiding this comment.
@StephenMcConnel made 4 comments.
Reviewable status: 0 of 2 files reviewed, all discussions resolved.
c74da97 to
4d2f61c
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
AI reviews have been addressed. |
JohnThomson
left a comment
There was a problem hiding this comment.
This all feels like only half a solution. See comment in the issue. At best this only helps when the bookref is in the SAME book. But it's very likely to be in a DIFFERENT book that we aren't even scanning.
@JohnThomson reviewed 2 files and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on StephenMcConnel).
src/BloomExe/Book/BookStorage.cs line 1351 at r2 (raw file):
{ /// I've seen a query parameter value that contains a literal ? (essentially the parameter itself /// contains a subquery string), which breaks the automatic parsing. See BL-16376.
Have/should we fix the bug that causes Bloom to append ?book-id=... when it should use &book-id=...? (At least I think your comments in the issue and here indicate that something is making invalid URLs with more than one question mark? Or maybe the issue is that something may wrongly add ?thumbnail or similar AFTER the book-id and file params?) If we have fixed it, or think someone might one day, then don't we need to handle bookfile&book-id=...? But then bookfile is not part of the param string at all, so if book-id might not be the FIRST param and file the second one, there are still more possibilities to consider. My new "transparent=" param is always added as the last param (and properly uses & if there are others), but I'm not sure about the PDF publishing code that adds something like OriginalImage as a param.
src/BloomExe/Book/BookStorage.cs line 1356 at r2 (raw file):
"bookFile\\?book-id=([^?&]*)&file=([^?&]*)" ); // Bloom doesn't allow + in its filenames. If it exists here, it's an extra level of encoding.
Sorry, but it does. I tried adding an image called "giraffe + baby.jpg" and Bloom put exactly that file into the book folder, with url of "giraffe%20%2b%20baby.jpg".
src/BloomExe/Book/BookStorage.cs line 1361 at r2 (raw file):
filenames.Add(matches[0].Groups[2].Value.Replace("+", " ")); } }
Should we consider the possibility that the book id is not for this book? If the image belongs to some other book in the collection, then it's not at risk for deletion here...I suppose it's a small risk that this book has an otherwise unused image that has the same name as the cover image of another book.
4d2f61c to
928f586
Compare
StephenMcConnel
left a comment
There was a problem hiding this comment.
I've totally changed the pull request to keep the problem from happening in the front cover image.
@StephenMcConnel made 6 comments.
Reviewable status: 0 of 8 files reviewed, 3 unresolved discussions (waiting on JohnThomson and StephenMcConnel).
src/BloomExe/Book/BookStorage.cs line 1351 at r2 (raw file):
Previously, JohnThomson (John Thomson) wrote…
Have/should we fix the bug that causes Bloom to append ?book-id=... when it should use &book-id=...? (At least I think your comments in the issue and here indicate that something is making invalid URLs with more than one question mark? Or maybe the issue is that something may wrongly add ?thumbnail or similar AFTER the book-id and file params?) If we have fixed it, or think someone might one day, then don't we need to handle bookfile&book-id=...? But then bookfile is not part of the param string at all, so if book-id might not be the FIRST param and file the second one, there are still more possibilities to consider. My new "transparent=" param is always added as the last param (and properly uses & if there are others), but I'm not sure about the PDF publishing code that adds something like OriginalImage as a param.
I removed this code.
src/BloomExe/Book/BookStorage.cs line 1356 at r2 (raw file):
Previously, JohnThomson (John Thomson) wrote…
Sorry, but it does. I tried adding an image called "giraffe + baby.jpg" and Bloom put exactly that file into the book folder, with url of "giraffe%20%2b%20baby.jpg".
I hate URL encoding that isn't consistent and sometimes uses old standards and sometimes new.
src/BloomExe/Book/BookStorage.cs line 1361 at r2 (raw file):
Previously, JohnThomson (John Thomson) wrote…
Should we consider the possibility that the book id is not for this book? If the image belongs to some other book in the collection, then it's not at risk for deletion here...I suppose it's a small risk that this book has an otherwise unused image that has the same name as the cover image of another book.
I've removed this code altogether. I fixed code in another place that was doubly decoding and changing a valid + character to a space before looking for a file.
d41150a to
dfb2880
Compare
Also handle bookFile request parameters without double decoding.
dfb2880 to
726b4a4
Compare
This change is