Open a conversation and look at the last message you sent. If it wrapped onto a second line, there is a good chance the timestamp sits under the text, on a line of its own, inside a bubble that suddenly has an empty strip at the bottom. Nothing is broken. It just looks like the bubble grew a chin.

In Folcadi, that strip is gone. When the text wraps, the time and delivery state now sit at the end of the final line, in the space the words did not need. When a message carries a translation, the same idea applies: the timestamp moves up onto the translation's label row or onto its last line, instead of adding yet another row beneath it. The bubble ends where the words end.

This is a small layout change, and most people will never notice it consciously. That is the point. The best chat chrome is the part you stop seeing. But getting it right took more measuring than expected, because a bubble does not always know how wide its text will be, and "just put it in a corner" is how you end up covering the last word.

What changed for someone using the app

A wrapped message now ends on its own last line. The timestamp is tucked into the trailing empty space, bottom-aligned with the text, so the bubble hugs the conversation instead of reserving a full row for two small characters.

Translations got the same treatment, in three steps:

  • If the translation block is already wide enough, the timestamp shares the row with the "AI Translated" or "Offline Translated" label.
  • If that row is too narrow but the translation's last line has room, the timestamp floats at the end of that line.
  • If the translation is a single line, the block may grow just enough to fit the timestamp beside it, but never past the bubble's normal content width.

Only when none of those fit does the timestamp keep its own line. A long translation still gets a normal footer, because squeezing a clock into a paragraph would be worse than the extra row.

Short messages behave exactly as before. If a message fits on one line, the text and the timestamp already shared a row, and that row reserved space for the clock. The new placement only starts once the text actually wraps.

Why the empty strip was worth fixing

Chat is read in glances. A conversation is a stack of bubbles, and every row you add to a bubble is a row that pushes the next message down. On a phone, that cost compounds: a message that says "on my way" should not occupy the same vertical space as a message that says "on my way, but the train is stuck and I will be about twelve minutes late".

The translation case was the louder one. A two-word translation used to take three rows: the label row, the translated line, and the footer. The label row and the footer were mostly empty. Reading a conversation with automatic translation on felt like scrolling through a form.

There was also a subtler problem. A bubble sized to a fixed width looked calm on its own and wrong in a list. The message text started at the leading edge, the timestamp sat at the bottom right, and the space between them was a small rectangle of nothing. Users do not describe that as "wasted layout"; they describe it as the app feeling loose.

The rules that keep it from looking accidental

Placing a floating element near text is easy to demo and easy to get wrong. The version that shipped follows a few invariants.

The timestamp never covers a glyph. Before choosing a line, the layout measures the footer and the free space on that line. It keeps a small gap and a safety margin. If the space is not there, the footer moves to a new line.

The trailing edge means the trailing edge in both directions. In a right-to-left language the timestamp belongs on the left side of the last line, not the right. Using a direction-aware position keeps that correct without a second layout.

Only plain paragraphs float. The trick is turned off for encrypted chats, media messages, replies, forwards, link previews, multi-line text and messages containing links. Those bubbles get their width from something other than one text paragraph, so the measurement would not describe what is on screen. A video player or a quote chip can change the layout after the text is laid out.

Animated emoji get their own path. Inline animated emoji are drawn as small animation widgets rather than glyphs. Their width is close to the text's, but not guaranteed to match, so the float is disabled while inline animation is active. A wrong guess there would put the clock on top of a sticker-sized emoji.

The placement re-runs when the width changes. Showing the speaker action beside a bubble takes 32 pixels, and that changes the text width. Turning animated emoji on or changing the motion level changes the metrics. Each of those now triggers a fresh measurement instead of leaving a stale corner in place.

For developers

The interesting part is not the Stack; it is deciding when the Stack is safe. A chat message can be an image, a video, a voice note, a reply, a forward, a link preview, a translation or some combination of those. The bubble width is often decided by the widest child, not by the text.

The implementation keeps the floating path deliberately narrow. It only activates when the message is a plain text paragraph: not encrypted, no media, no reply, no forward, no link preview, no newlines and no links. Even then, it is skipped while an animatable emoji is present and inline animation is enabled.

When the path is eligible, the text width is estimated from the bubble cap (90% of the row, reduced by 32 pixels when the speaker slot is shown) minus the card's margins and padding. A TextPainter lays out the content at that width with the current text direction and text scaler. The painter's line metrics give the last line's width. If the remaining space is at least the footer width plus an 8-pixel gap and a 4-pixel safety margin, the widget pins the text to that width and overlays the footer with PositionedDirectional(end: 0, bottom: 0).

Two details matter more than they look:

  • The width must come from the same constraints the text actually receives. The bubble is capped at 90% of the row; the speaker action narrows that cap; the card adds its own margins and padding. Miss one term and the footer either overlaps the text or floats in space.
  • The measurement must not run inside an intrinsic pass. Reply bubbles wrap their content in an IntrinsicWidth, and intrinsic layout calls the builder with unconstrained widths. The floating path is excluded for replies for that reason, not because the visual result would be bad.

The translation block is a small layout engine of its own. Its caller measures the label, the widest natural line of the translation, and the footer. It then picks the first option that fits:

  1. The label row, when the block is already at least as wide as label + gap + footer.
  2. The last line, when the free space after the last line's metrics covers the footer, gap and safety margin.
  3. A widened one-line block, when the translation's max intrinsic width is within the content width and the widened width still fits the footer.
  4. Otherwise, the existing footer row.

The block takes an optional trailing widget for option 1 and an optional last-line widget plus the chosen width for options 2 and 3. When no width is supplied it keeps the old intrinsic sizing, so callers that do not opt in render exactly as before.

The regression test is a widget test that pumps a real message at a fixed row width and asserts geometry, not a golden image. It checks that the footer's bottom aligns with the text's bottom, that its trailing edge matches the text's trailing edge, and that its leading edge is past the right edge of the last character. A second case repeats that in an Arabic locale. Translation cases check the label row, the short last line, the widened one-line block, and the Babel label path. Geometry assertions survive font changes better than pixel snapshots, and they fail for the reason you care about: the footer moved.

The takeaway is general. If a layout decision depends on the width of rendered text, measure it with the same constraints the text will get, keep the special cases explicit, and make the fallback boring. The fallback is what runs on the messages nobody thought to test.

FAQ

Does this work with long translations?

Yes, up to the point where the timestamp genuinely fits. A long translation keeps the footer on its own line, because a clock in the middle of a paragraph is harder to read than an extra row.

Does it change the timestamp on images or replies?

No. Those bubbles are sized by media, quotes or previews, so the text-based measurement does not apply. They keep the existing footer row.

Why not always widen the bubble a little to fit the timestamp?

Because a bubble that grows for the clock is a bubble that looks inconsistent with its neighbours. Widening is allowed only for a single-line translation that already fits inside the normal content width. Everything else falls back rather than pushing the layout around.

Does it work in right-to-left languages?

Yes. The footer is positioned at the direction-aware trailing edge, so it appears on the left in Arabic and on the right in a left-to-right locale.

The result is not a feature you will show someone. It is the kind of change that makes a conversation feel tighter without anyone being able to say why. If you build chat UI, the last line is worth treating as space, not as decoration.

Get Folcadi — a language-exchange messenger with live translation.