Skip to content

add an initial state for 'browser_setting' variable.#4731

Closed
hcvcastro wants to merge 1 commit into
nextcloud:mainfrom
hcvcastro:pr/main/03
Closed

add an initial state for 'browser_setting' variable.#4731
hcvcastro wants to merge 1 commit into
nextcloud:mainfrom
hcvcastro:pr/main/03

Conversation

@hcvcastro
Copy link
Copy Markdown
Member

After the file browsersettings.json is uploaded, it’s necessary to create an initial state for the user’s browser preference settings. This enables the Collabora iframe to include the POST variable and serve preprocessed HTML with accessibility features enabled, for example.

@elzody
Copy link
Copy Markdown
Collaborator

elzody commented May 6, 2025

The code seems reasonable, even if I have a bit of a difficult time understanding its purpose. The only thing that would need to be resolved is the PHP lint failure, which can be fixed with a simple composer run cs:fix.

@hcvcastro
Copy link
Copy Markdown
Member Author

Thanks! I’ll fix it using composer run cs:fix.

After the file browsersettings.json is uploaded, it’s necessary
to create an initial state for the user’s browser preference settings.
This enables the Collabora iframe to include the POST variable and
serve preprocessed HTML with accessibility features enabled, for example.

Signed-off-by: Henry Castro <hcastro@collabora.com>
$this->initialState->provideInitialState('open_local_editor', $this->config->getAppValue(Application::APPNAME, 'open_local_editor', 'yes') === 'yes');
$fileName = $this->config->getUserValue($this->userId, Application::APPNAME, 'browsersetting');
if ($fileName) {
$browserSetting = $this->settingsService->getSettingsFile('userconfig/' . $this->userId,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rather bad performance wise. File system access is rather slow and the initial state is built on every page load, so wondering if we shall rather write this to a memory cache

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re correct. We’re testing some features, and the patch will likely be discarded. If not, I’ll improve it. Thanks!

@juliusknorr juliusknorr marked this pull request as draft May 13, 2025 12:19
@hcvcastro hcvcastro closed this May 14, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants