Skip to content

Annotations: FE#6481

Merged
apata merged 19 commits into
masterfrom
annotations/fe
Jul 13, 2026
Merged

Annotations: FE#6481
apata merged 19 commits into
masterfrom
annotations/fe

Conversation

@apata

@apata apata commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds the rest of Annotations feature. Depends on the BE PR.

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

Dark mode

  • The UI has been tested both in dark and light mode

TODO after merge

@apata apata added the preview label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Preview environment👷🏼‍♀️🏗️
PR-6481

@apata apata changed the title Add Annotations feature Annotations: FE Jul 3, 2026
Base automatically changed from annotations/be to master July 8, 2026 14:33
@apata apata mentioned this pull request Jul 8, 2026
4 tasks
apata and others added 9 commits July 8, 2026 19:51
…attern

- Show the site option as a disabled radio with a plan pill and hover tooltip instead of an inline warning message
- Add a reusable UpgradePill with diamond icon in both React and LiveView and use it in the annotation, segment, and goal settings modals plus the feature setup notice
@apata
apata force-pushed the annotations/fe branch from 35e0106 to e81e9a5 Compare July 8, 2026 18:41
Comment thread assets/js/dashboard/annotations/annotation-list-items.tsx Outdated
Comment thread assets/js/dashboard/annotations/annotations-modals.tsx Outdated
Comment thread assets/js/dashboard/annotations/annotations-modals.tsx Outdated
Comment thread assets/js/dashboard/annotations/annotations-modals.tsx Outdated
Comment thread assets/js/dashboard/annotations/annotations-modals.tsx
Comment thread assets/js/dashboard/annotations/annotations-modals.tsx Outdated
Comment thread assets/js/dashboard/annotations/annotations.test.ts
Comment thread assets/js/dashboard/annotations/annotations.ts
Comment thread assets/js/dashboard/stats/graph/main-graph.tsx
{!!annotationDatetime && canAddAnnotation && (
<Button
size="xs"
className="flex-1 bg-gray-600/70 border-gray-600/70 hover:bg-gray-600 hover:border-gray-600"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The classname between the two buttons should be exactly the same so perhaps let's extract that into a variable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, true that it is duplicative... AFAIK TW recommends against variables though. They suggest to generate repetitive items with map, or extract to component, or to use multicursor when editing. I can do the map thing, but it creates this situation:

      {hasActions && (
        <div className="flex flex-row gap-x-2 mt-2">
          {[
            !!annotationDatetime &&
              canAddAnnotation && {
                text: 'Add note',
                onClick: () => {
                  closeTooltip()
                  setModal({
                    type: 'create-annotation',
                    annotation: {
                      type: AnnotationType.personal,
                      datetime: annotationDatetime,
                      granularity: getAnnotationGranularity(interval)
                    }
                  })
                }
              },
            !!zoomDate && {
              text: `View ${interval}`,
              onClick: () => onZoomToPeriod(zoomDate)
            }
          ]
            .filter((b) => !!b)
            .map(({ text, onClick }) => (
              <Button
                key={text}
                size="xs"
                className="flex-1 bg-gray-600/70 border-gray-600/70 hover:bg-gray-600 hover:border-gray-600"
                onClick={onClick}
              >
                {text}
              </Button>
            ))}
        </div>
      )}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense. Maybe extracting a simple button component would be the cleanest approach then?

function TooltipActionButton(props) {
  const className = "flex-1 bg-gray-600/70 border-gray-600/70 hover:bg-gray-600 hover:border-gray-600"
  return <Button className={className} {...props}>
}

Fine for me to leave the duplicate classes though.

@apata
apata added this pull request to the merge queue Jul 13, 2026
Merged via the queue into master with commit a3a2f31 Jul 13, 2026
37 of 39 checks passed
@apata
apata deleted the annotations/fe branch July 13, 2026 10:59
@zoldar zoldar removed the preview label Jul 15, 2026
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.

4 participants