Edit workspace files directly on web (#2270)
* feat(files): edit workspace files on web Keep source buffers synchronized with host file changes and require an explicit overwrite or reload when revisions diverge. * feat(panels): surface and protect modified tabs Expose tooltip and modification state through the generic panel boundary so tabs can show stable metadata and guard every close route consistently. * fix(tests): use portable fake timeout handle * fix(files): harden editor conflict handling Preserve modified panel state across tab eviction, use precise revisions for optimistic writes, coalesce concurrent file watchers, and localize the editor interface. * fix(files): close editor concurrency gaps Coalesce clean reloads, preserve subscriber identities and file permissions, suspend pending saves during close confirmation, and carry precise revisions through file reads. * test(files): expect read revision metadata
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Switch, Text, View } from "react-native";
|
||||
import { useCallback } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppSettings } from "@/hooks/use-settings";
|
||||
import { SettingsSection } from "./settings-section";
|
||||
import { settingsStyles } from "@/styles/settings";
|
||||
|
||||
export function EditorSection() {
|
||||
const { t } = useTranslation();
|
||||
const { settings, updateSettings } = useAppSettings();
|
||||
const handleChange = useCallback(
|
||||
(vimKeybindings: boolean) => void updateSettings({ vimKeybindings }),
|
||||
[updateSettings],
|
||||
);
|
||||
return (
|
||||
<SettingsSection title={t("settings.editor.title")}>
|
||||
<View style={settingsStyles.card}>
|
||||
<View style={settingsStyles.row}>
|
||||
<View style={settingsStyles.rowContent}>
|
||||
<Text style={settingsStyles.rowTitle}>{t("settings.editor.vimKeybindings")}</Text>
|
||||
<Text style={settingsStyles.rowHint}>{t("settings.editor.vimHint")}</Text>
|
||||
</View>
|
||||
<Switch
|
||||
value={settings.vimKeybindings}
|
||||
onValueChange={handleChange}
|
||||
accessibilityLabel={t("settings.editor.vimKeybindings")}
|
||||
testID="vim-keybindings-toggle"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</SettingsSection>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user