file-tree: show python packages button for all quarto projects
Build and Deploy Verso / deploy (push) Successful in 13m42s
Build and Deploy Verso / deploy (push) Successful in 13m42s
The previous approach (pdfFile?.path === 'output.html') caused a chicken-and-egg problem: the button only appeared after a successful RevealJS compile, but you need to add packages before the first compile. Use compiler === 'quarto' from ProjectSettingsContext instead — this is set from project metadata and available immediately, before any compile. Quarto supports Jupyter Python cells in all output formats (RevealJS HTML, PDF via LaTeX, PDF via Typst), so showing the button for any Quarto project is the correct behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { usePermissionsContext } from '@/features/ide-react/context/permissions-
|
||||
import FileTreeActionButton from './file-tree-action-button'
|
||||
import { useRailContext } from '../../ide-react/context/rail-context'
|
||||
import PythonRequirementsModal from './python-requirements-modal'
|
||||
import { useDetachCompileContext as useCompileContext } from '@/shared/context/detach-compile-context'
|
||||
import { useProjectSettingsContext } from '@/features/editor-left-menu/context/project-settings-context'
|
||||
|
||||
export default function FileTreeActionButtons({
|
||||
fileTreeExpanded,
|
||||
@@ -20,8 +20,8 @@ export default function FileTreeActionButtons({
|
||||
const { write } = usePermissionsContext()
|
||||
const { handlePaneCollapse } = useRailContext()
|
||||
const [showPythonModal, setShowPythonModal] = useState(false)
|
||||
const { pdfFile } = useCompileContext()
|
||||
const isRevealJs = pdfFile?.path === 'output.html'
|
||||
const { compiler } = useProjectSettingsContext()
|
||||
const isQuarto = compiler === 'quarto'
|
||||
|
||||
const {
|
||||
canCreate,
|
||||
@@ -115,7 +115,7 @@ export default function FileTreeActionButtons({
|
||||
iconType="delete"
|
||||
/>
|
||||
)}
|
||||
{write && isRevealJs && (
|
||||
{write && isQuarto && (
|
||||
<FileTreeActionButton
|
||||
id="python-packages"
|
||||
description={t('python_packages')}
|
||||
|
||||
Reference in New Issue
Block a user