Skip to content

content: Global times in a link span should be link-colored, but aren't #1819

@chrisbobbe

Description

@chrisbobbe

Web:

Image

Mobile:

Image

We even have a test that the clock icon and the date-time text are the same color as each other:

  • when the global time appears in a link span, and
  • when it doesn't
    void testIconAndTextSameColor(String description, String html) {
      testWidgets('clock icon and text are the same color: $description', (tester) async {
        await prepareContent(tester,
          // We use the self-account's time-format setting.
          wrapWithPerAccountStoreWidget: true,
          plainContent(html));

        final icon = tester.widget<Icon>(
          find.descendant(of: find.byType(GlobalTime),
            matching: find.byIcon(ZulipIcons.clock)));

        final textColor = mergedStyleOf(tester,
          findAncestor: find.byType(GlobalTime), renderedTextRegexp)!.color;
        check(textColor).isNotNull();

        check(icon).color.isNotNull().isSameColorAs(textColor!);
      });
    }

    testIconAndTextSameColor('common case', '<p>$timeSpanHtml</p>');
    testIconAndTextSameColor('inside link', '<p><a href="https://example/">$timeSpanHtml</a></p>');

But the in-link-span test doesn't do the further check that that color is blue, which allowed this bug to slip through. 🫠

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-contentParsing and rendering Zulip HTML content, notably message contents

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions