evidence icon indicating copy to clipboard operation
evidence copied to clipboard

generated tabs are broken in latest update

Open fboerman opened this issue 1 year ago • 6 comments

Steps To Reproduce

generate tabs from a query like this:

<Tabs>
{#each hubs as hub}
<Tab label="{hub.hub}">

<LineChart
  data={np_combined.where(`hub = '${hub.hub}' `)}
  x=mtu
  y={["NP", "min_np", "max_np"]}
  step=true
  chartAreaHeight=300
  yFmt={`0 "MW"`}
  title="Net Position of {hub.hub} in CORE for {params.businessday} within its theoretical boundaries"
  colorPalette={amunColors}
/>

<LineChart
  data={np_util.where(`hub = '${hub.hub}' `)}
  x=mtu
  y=util_pct
  step=true
  title="Net Position of {hub.hub} in CORE for {params.businessday} as percentage of min/max"
  sort=false
  yMin=0
  yMax=1
  yFmt="pct2"
/>

</Tab>
{/each}
</Tabs>

Environment

  • Node version (node -v): v20.12.2
  • npm version (npm -v): 10.5.2
  • OS: archlinux
  • Browser: firefox
  • Database: postgres (but probably unrelated)

Expected Behavior

tabs to generate with names

Actual Behaviour

tabs look like below and the content of all tabs is generated below eachother Screenshot_select-area_20240504151858

Workarounds

none that I know of so far

fboerman avatar May 04 '24 13:05 fboerman

update after talking to @hughess it probably has to do with not waiting for query result. because generating tabs in a loop like this works:

<Tabs>
{#each ['one', 'two'] as tab}
<Tab label={tab}>

  content {tab}

</Tab>
{/each}
</Tabs>

fboerman avatar May 04 '24 13:05 fboerman

Note that you should always use {#each} blocks wrapped in newlines like this

<Tabs>

{#each ['one', 'two'] as tab}

<Tab label={tab}>

  content {tab}

</Tab>

{/each}

</Tabs>

reason: markdown is newline sensitive

archiewood avatar May 04 '24 19:05 archiewood

hi @archiewood that doesnt actually fix my issue so I dont understand why you are closing this? the bug still exists

fboerman avatar May 04 '24 19:05 fboerman

Sorry, didn't mean to close, hit the wrong button on mobile

archiewood avatar May 04 '24 20:05 archiewood

Should follow up post-release to confirm, but this should be addressed by the fixes in #1980

ItsMeBrianD avatar May 07 '24 02:05 ItsMeBrianD

@ItsMeBrianD - still occurring on next afaict

mcrascal avatar May 15 '24 18:05 mcrascal