Coder Social home page Coder Social logo

Comments (2)

awdeorio avatar awdeorio commented on May 18, 2024 1

This is very tricky! The "easiest" way to implement something like this would be to add Git as a dependency (ugh).

A few problems that could pop up.

  • What if I view the spec, then the spec changes, then I clear my cookies and cache, then I view the spec again?
  • What if I view the spec, then the spec changes, then I view the spec with a different web browser?
  • What if I view the spec, then the spec changes, then I view the spec with private browsing mode?
  • What if there's an important change to the spec and I want to view that diff at a later time? Is there a permalink?
  • What if there are several changes, is there a way to view the history of changes?
  • What if something trivial changes, like a spelling error?
  • What if I'm in, say EECS 280, and I have no idea what HTML is. Will I have to understand an HTML diff?
  • HTML content (the English part) is often very long lines. Will the UI make it clear what words changed in a very long line?

One possible alternative would be to automatically generate some sort of changelog. This could be viewed as a separate web page and link to the relevant new parts of the spec.

Another possible alternative would be to simply detect the last modified date. Then, put a big fat warning at the top if it changes saying "contact the course staff" or something like that. If profs are changing the spec in the middle of a project and they don't add a changelog to the top of the spec, they deserve to be chastised with many emails.

from primer-spec.

seshrs avatar seshrs commented on May 18, 2024

Thanks for your detailed notes and questions @awdeorio! I really appreciate it 😃

Clearly I need to think through what this would look like for students a bit more. I’ll explain my rationale a bit further, and we can determine if such a feature still makes sense.


This feature shouldn’t replace manually-written changelogs. (If a project is changed in the middle of a semester, the best way for staff to communicate the nature of the changes is via a changelog.)

However, even if a changelog is maintained, students may not realize that the spec has changed if they aren’t looking at the changelog. This has happened to me a few times as a student 😅

You’re right that there are a bunch of problematic cases. IMO I think false negatives are fine (since it would behave just like it does today). But if we happen to detect a change, it might be nice to let students know to check the changes.

I like the idea of a floating warning banner at the top of the page :)

What if there's an important change to the spec and I want to view that diff at a later time? Is there a permalink?

What if there are several changes, is there a way to view the history of changes?

I think showing the warning banner once per change is sufficient. I don’t want to replace the need for changelogs, and permalinks might add a lot of complexity 😅

What if something trivial changes, like a spelling error?

Great question! My guess is that it doesn’t hurt for students to see what typos have been fixed...? At the same time, I wonder if students would panic if they saw warning banners when the changes are minor. I’d hope that students would view the diff to be sure...

What if I'm in, say EECS 280, and I have no idea what HTML is. Will I have to understand an HTML diff?

HTML content (the English part) is often very long lines. Will the UI make it clear what words changed in a very long line?

I was thinking of generating a rich diff preview like GitHub does for Markdown files. Something like this. We can tweak the diffing algorithm to work with longer lines better.

One possible alternative would be to automatically generate some sort of changelog. This could be viewed as a separate web page and link to the relevant new parts of the spec.

This might be possible, maybe clicking the warning banner opens a new tab with this rich diff. I’m not entirely sure how it would work with Jekyll sites though, I’ll have to investigate...

Another possible alternative would be to simply detect the last modified date.

Unfortunately, I don’t think this is possible. 😞 The Jekyll theme only has access to the time at which the entire site is regenerated. This doesn’t indicate if a page has changed since the student last visited — in fact, every commit to master regenerates the site — so we’d end up with a bunch of false positives.

from primer-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.