Repository navigation
Description
Problem
The FAQ entry "Can I write Android-only or iOS-only code?" in docs/meta/faq.md only shows IS_ANDROID and IS_IOS. It still needs an explicit branch for browser preview behavior.
The original desktop instructions are obsolete: #74 replaced the Tkinter preview. On current main, pn preview and pn start set PN_PLATFORM=web; pythonnative.utils.IS_WEB and Platform.is_web identify this runtime, and Platform.OS is "web". IS_DESKTOP and docs/guides/desktop-preview.md no longer exist.
This remains a small documentation issue. It is assigned to @nigelseah24, whose existing PR #85 should be updated for this scope.
Requested change
-
Extend the FAQ's platform-branching bullet and snippet to include
IS_WEB:from pythonnative.utils import IS_ANDROID, IS_IOS, IS_WEB if IS_ANDROID: ... elif IS_IOS: ... elif IS_WEB: ...
-
Explain that
pn preview/pn startusePN_PLATFORM=webfor the browser preview, and link to../guides/browser-preview.md. -
Keep the link to
Platform.select({...})in../api/platform.mdas the declarative alternative. The preview uses the"web"key. -
Keep the existing distinction that browser preview is a development tool; Android and iOS are the app deployment targets.
-
Update PR docs(mkdocs): cover IS_WEB in the platform-specific code FAQ #85's title and description to refer to browser preview /
IS_WEB.
Scope: the platform-specific code FAQ. No runtime changes or new desktop compatibility flags are needed. The Platform reference and browser preview guide already document the current APIs.
Follow AGENTS.md and the documentation style guide: straight quotes, no em dashes, and CMOS grammar.
Verification
uv run --group docs mkdocs build --strictpasses.- View the FAQ with
uv run --group docs mkdocs serve; check the snippet and both guide/API links. - The change contains no
IS_DESKTOPimports or links to the removed desktop preview guide.
Suggested commit message
docs(mkdocs): cover IS_WEB in the platform-specific code FAQ
Activity
nigelseah24 commentedon Sep 2, 2026
You can assign me to this as well @owenthcarey :)
nigelseah24 commentedon Sep 8, 2026
hi @owenthcarey , is this issue still open since the desktop version is obsolete?
[-]FAQ on platform-specific code omits `IS_DESKTOP`[/-][+]FAQ on platform-specific code omits the browser preview (`IS_WEB`)[/+]owenthcarey commentedon Sep 9, 2026
@nigelseah24, yes, the documentation gap is still open, but the desktop-specific instructions were stale. Sorry I didn't update them when #74 replaced the Tkinter preview.
I've rewritten this issue for the browser preview: use
IS_WEB,PN_PLATFORM=web, and../guides/browser-preview.md. Your assignment stays in place. Please adapt your existing PR #85 to the updated scope; there's no need to start another PR. ThePlatform.selectlink you added is still useful, with"web"as the preview key. Thanks for flagging this before continuing.docs(mkdocs): cover IS_WEB in the platform-specific code FAQ (#85)