Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): file explorer tab #106

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

oshcherbakovv
Copy link

No description provided.

@oshcherbakovv oshcherbakovv self-assigned this Feb 4, 2025
@oshcherbakovv oshcherbakovv requested a review from a team as a code owner February 4, 2025 21:39
@oshcherbakovv
Copy link
Author

image

@@ -363,5 +363,7 @@
"CPU Platform": "CPU платформасы",
"OS": "ОС",
"SDK": "Sdk",
"ABI": "АТИ"
"ABI": "АТИ",

Choose a reason for hiding this comment

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

Do not translate

<Input
beforeAlign='end'
className={styles.input}
value={fileExplorerService.currentPath}

Choose a reason for hiding this comment

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

I don't think it's necessary to store the editing value in the store directly. useStore should be sufficient and makes sense when you consider this input as a form input
We can change the store value in onSubmit or onBlur

Copy link
Author

Choose a reason for hiding this comment

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

I switched to using a form, but I can't make the state local because I update the editing value in a different component, for example, when I click on a folder

Comment on lines 4 to 12
const permissionSymbols = ['x', 'w', 'r']

let result = ''

for (let i = 0; i < permissionSymbols.length; i++) {
for (let j = 0; j < permissionSymbols.length; j++) {
result = ((value >> (i * permissionSymbols.length + j)) & 1) !== 0 ? permissionSymbols[j] + result : '-' + result
}
}

Choose a reason for hiding this comment

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

looks complicated
Why not

Suggested change
const permissionSymbols = ['x', 'w', 'r']
let result = ''
for (let i = 0; i < permissionSymbols.length; i++) {
for (let j = 0; j < permissionSymbols.length; j++) {
result = ((value >> (i * permissionSymbols.length + j)) & 1) !== 0 ? permissionSymbols[j] + result : '-' + result
}
}
const permissionSymbols = ['x','w','r','x','w','r','x','w','r']
let result = ''.join(permissionSymbols.map((v, ind) => {
if ((value >> (ind)) & 1) {
return v;
} else {
return '-';
}
})

const uninstallResult = await this.deviceControlStore.uninstall(packageName)
await uninstallResult.donePromise

await this.deviceControlStore.uninstall(packageName)

Choose a reason for hiding this comment

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

Why call second time?

Comment on lines 67 to 72
const fsRetrieveResult = await this.deviceControlStore.fsRetrieve(path)
const { content } = await fsRetrieveResult.donePromise

if (content) {
window.open(`${content.href}?download`, '_blank')
}

Choose a reason for hiding this comment

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

This seems inefficient when dealing with large files. Maybe we can stream the result?

@oshcherbakovv oshcherbakovv merged commit 3dfac12 into master Feb 7, 2025
2 checks passed
@oshcherbakovv oshcherbakovv deleted the o.shcherbakov/file-explorer-tab/QA-16181 branch February 7, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants